简体   繁体   English

从本地 Mongo DB 迁移到 Mongo DB Atlas 时,spring-data-mongodb 依赖是否足够?

[英]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.我有一个项目(用 Java 编写),其中有一个本地 Mongo DB 连接。 I use the following dependency in the pom.xml我在 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.现在,我想将我的项目和数据迁移到 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.我正在阅读文档并试图了解 Mongo DB Atlas 是否支持上述依赖项,另外我是否需要添加任何其他依赖项。 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.此链接https://www.mongodb.com/compatibility/spring-boot描述了如何将 MongoDB Atlas(其中使用 spring-boot-starter-data-mongodb 依赖项而不是我使用的那个)与 Spring Boot 集成,但我是在我的项目中没有使用 Spring Boot。

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.此外,我没有在我使用的依赖项文档( https://spring.io/projects/spring-data-mongodb )或 MongoDB Atlas 文档( https ://www.mongodb.com)中找到 MongoDB Atlas 的任何内容/atlas ) 或其他 StackOverflow 问题。

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我拥有的唯一暗示我的依赖性足够的线索来自以下 SO 问题: 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.您只需将 MongoDB 连接字符串更改为指向 Atlas。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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