0

I just started today to learn MongoDB. After installing compass I searched for a way to create a new database and add a username and password for it, but there is no such thing. I also searched online but only found this here which describes how to do it in the command line, but I want to do it from compass, is this not possible?

I mention that I need it to configure a spring boot application.properties file on the localhost by giving the user and password like here:

#Local MongoDB config
spring.data.mongodb.authentication-database=admin
spring.data.mongodb.username=root
spring.data.mongodb.password=root
spring.data.mongodb.database=user_db
spring.data.mongodb.port=27017
spring.data.mongodb.host=localhost

I want to connect to the mongodb similar to how one connects to MySQL. Is this possible? can you please help me do that? Any help provided will be greatly appreciated!

Jason Aller
  • 3,541
  • 28
  • 38
  • 38
helloApp
  • 449
  • 1
  • 4
  • 21

1 Answers1

-1

For MongoDB, you can create the database by using the command line

use yourDbName
Rebai Ahmed
  • 1,509
  • 1
  • 14
  • 21