Question

Spring MongoDb is still stuck with v 2.10 of the mongo client.
is it ok to use a more recent version of the mongo driver with spring mongodb or will that break things?

Was it helpful?

Solution

Yes, you can use Spring Data MongoDB with newer versions of the Java driver than the one declared in the POM. Spring Data MongoDB is not stuck with 2.10. We generally handle the versions and version upgrades for Spring Data modules as follows:

A root GA release (x.x.0) ships declared with the latest version of a dependency at the time of the release. For the current Spring Data MongoDB version 1.3.4.RELEASE this was version 1.3.0.RELEASE (September, 2013. It refers to the Mongo Driver in version 2.10.1 which was the latest at that point in time.

The version declaration means: we built against this dependency, and have run integration tests. This of course does not mean that you have to use this particular dependency version with the library. You can effectively use any more recent version of it as long as it stays compatible with the version we compiled against. So version declarations for all transitive dependencies are lower boundaries up to versions of the dependencies that break APIs or semantics.

We generally do not raise dependency versions within bug fix releases to not force users in having to upgrade transitive dependencies just to be able to benefit from a bug fix on our side. However - as explained above - nobody prevents you from using a newer version of the dependency in general.

For the upcoming 1.4 release of Spring Data MongoDB we're on driver version 2.11.4 already and just have added some compatibility tweaks to make sure the release will be compatible with the upcoming 2.12 release of the driver.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top