弹簧:spring-data-mongodb 或 spring-boot-starter-data-mongodb

Jor*_*rdi 5 spring spring-boot

两者有什么区别

<dependency>
    <groupId>org.springframework.data</groupId>
    <artifactId>spring-data-mongodb</artifactId>
</dependency>
Run Code Online (Sandbox Code Playgroud)

和,

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-data-mongodb</artifactId>
</dependency>
Run Code Online (Sandbox Code Playgroud)

我正在开发一个弹簧启动服务。

Mik*_*ike 6

spring-boot-starter-data-mongodb包含 Spring Boot 的配置类。它还包括该spring-data-mongodb库,因此您只需要在启动应用程序中包含启动:

https://search.maven.org/artifact/org.springframework.boot/spring-boot-starter-data-mongodb/2.0.5.RELEASE/jar