- MongoDB Driver
- Getting Started
- Installation Guide
Installation
There are two Maven artifacts available in the 3.0 release. The preferred artifact for new applications is mongodb-driver
however, we still publish the legacy mongo-java-driver
uber-jar.
The recommended way to get started using one of the drivers in your project is with a dependency management system.
MongoDB Driver
The MongoDB Driver is the updated synchronous Java driver that includes the legacy API as well as a new generic MongoCollection interface that complies with a new cross-driver CRUD specification.
important
For OSGi-based applications: due to the fact that there are classes from the com.mongodb
package in both this artifact and in the
mongodb-driver-core
artifact, on which this depends, this artifact is not an OSGi bundle. Please use the mongo-java-driver
uber
jar (described below) instead.
You can also download the jars
directly
from sonatype.
Note:
<dependencies>
<dependency>
<groupId>org.mongodb</groupId>
<artifactId>mongodb-driver</artifactId>
<version>3.0.4</version>
</dependency>
</dependencies>
mongodb-driver
requires the following dependencies:
bson
and
mongodb-driver-core
Uber MongoDB Java Driver
An uber jar that contains everything you need; the BSON library, the core library and the mongodb-driver.
Note
For OSGi-based applications: this artifact is a valid OSGi bundle.
You can also download the jars
directly
from sonatype.
<dependencies>
<dependency>
<groupId>org.mongodb</groupId>
<artifactId>mongo-java-driver</artifactId>
<version>3.0.4</version>
</dependency>
</dependencies>