Dchris
Dchris

Reputation: 3067

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.

Upvotes: 0

Views: 386

Answers (1)

Pavel Bely
Pavel Bely

Reputation: 2415

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

Upvotes: 0

Related Questions