简体   繁体   中英

Is spring-data-mongodb dependency sufficient when migrating from Mongo DB local to Mongo DB Atlas?

I have a project(written in Java) where i have a local Mongo DB connection. I use the following dependency in the pom.xml

<dependency>
   <groupId>org.springframework.data</groupId>
   <artifactId>spring-data-mongodb</artifactId>
</dependency>

Now, i want to migrate my project and data to Mongo DB Atlas. I am reading the documentation and trying to understand if the above dependency is supported by Mongo DB Atlas and additionally if i will need to add any other dependency. This link https://www.mongodb.com/compatibility/spring-boot describes how to integrate MongoDB Atlas(where is using spring-boot-starter-data-mongodb dependency and not the one i use) with Spring Boot but i am not using Spring Boot in my project.

Also, i did not find anything for MongoDB Atlas in the documentation of the dependency i use( https://spring.io/projects/spring-data-mongodb ) or in MongoDB Atlas documentation( https://www.mongodb.com/atlas ) or other StackOverflow questions.

The only clue i have which implies that my dependency is sufficient is from the following SO question: How to connect Mongodb Atlas to Spring

But i would like to find an official reference.

Yes, it should be sufficient. You just need to change MongoDB connection string to point to Atlas.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM