I am new to mongoDB and Spring so want some clarification.
I went through many tutorials some just use
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-mongodb</artifactId>
<version>1.7.2.RELEASE</version>
</dependency>
while others use :
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-mongodb</artifactId>
<version>1.7.2.RELEASE</version>
</dependency>
<dependency>
<groupId>org.mongodb</groupId>
<artifactId>mongo-java-driver</artifactId>
<version>2.11.0</version>
</dependency>
So what is the use of mongo-java-driver ? and why is it required if we can connect to mongoDB without it?
You only combine them when
You are using Spring Data Framework (otherwise, you'd only need the Mongo driver)
You want to use a Mongo Driver other than 2.13.0, which is included already (referring to your first POM)
By the way 1.7.2.RELEASE
was released 2015, so best go upgrade
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.