Skip to content

Ravishankarcode/Connect-MongoDB-Cloud-With-SpringBoot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Connect-MongoDB-Cloud-With-SpringBoot

Step to Connect MongoDB Cloud Using Spring Boot

  1. First Connect to MongoDB Cloud by using MongoDB Compass Community .

syntex::

mongodb+srv://<username>:<password>@<hostname>/<dbname>

Example::

mongodb+srv://profiledbuser:<password>@profilemongocluster01.v8s6i.mongodb.net/ProfileApp
             or

  1. In Properties File, you have to add two key-value pairs.
spring.data.mongodb.uri=mongodb+srv://profiledbuser:<password>@profilemongocluster01.v8s6i.mongodb.net/ProfileApp?retryWrites=true&w=majority
spring.data.mongodb.database=ProfileApp
  1. After Running your application you can see your save value in Spring Cloud.

Note:

At the time any interaction with MongoDB Cloud, make sure your VPN is disconnected.

About

Step to Connect MongoDB Cloud Using Spring Boot

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages