Sign up page https://cloud.mongodb.com, then following the below steps.
- Create a new Cluster.
- When the cluster is available, in Security column, config the permission for Database Access:
- Choose the default Method is SCRAM Authentication, set user name + password.
- Choose User Privileges.
- Next, we create a database and collection in the Clusters.
- To connect to the Cluster, we need to get the connection string:
- Choose the Connect button then select "Connect Your Application" (If you use MongoDB client Compass choose "Connect Your MongoDB Compass").
- In String mongodb+srv://:--- replace the content in <> by your user name & password in Database Access config.
- In application*.properties files, assign connection string to spring.data.mongodb.uri and database name to spring.data.mongodb.database.
To install and run the application in your local, for window following this instructional video https://www.youtube.com/watch?v=Y7O3U7DRwWk. For macos : https://www.youtube.com/watch?v=DX15WbKidXY
(NOTE: these below example steps are applied for window user)
- After successful installation, create a folder for the data files. By default, this will be C:\data\db.
- Create a folder for the log files. By default, this will be C:\data\log. Open a command prompt, change the working directory to C:\Program Files\MongoDB\Server\3.2\bin and start the database server, mongod.exe.
- At this stage, you should be ready to roll. Open another command prompt and start the database client, mongo.exe which you’ll find in the same folder as mongod.exe.