The Java driver for MongoDB
Java Groovy Shell
Latest commit b35d06a Jan 17, 2017 @jyemin jyemin JAVA-2442: Default to cursor results in DBCollection for aggregation,…
… force sending of cursor document to aggregate command for 3.6 servers
Failed to load latest commit information.
.evergreen JAVA-2350: Add traps Jan 27, 2017
bson Javadoc: Corrected @since values Feb 2, 2017
config JAVA-2409: Remove redundant files in driver module … Dec 14, 2016
docs Docs: JS fix for search form (#175) Jan 30, 2017
driver-async Checkstyle fixes Jan 18, 2017
driver-core JAVA-2442: Default to cursor results in DBCollection for aggregation,… Feb 21, 2017
driver JAVA-2442: Default to cursor results in DBCollection for aggregation,… Feb 21, 2017
gradle Build: Updated Gradlew and Checkstyle Jan 18, 2017
mongo-java-driver JAVA-2308: Remove un-used code Sep 14, 2016
util Add a new test category for slow tests that either don't need a runni… Nov 4, 2015
.gitattributes Removed special treatment for .bat files Jun 4, 2013
.gitignore JAVA-2365, JAVA-2367, JAVA-2351, JAVA-2357: Full evergreen test matrix Jan 11, 2017
.travis.yml Updated travis.yml build Nov 9, 2015 update documentation for running tests to explicitly mention required… Aug 26, 2016 Release r2.7.3 Jan 30, 2012
Issues.txt Renamed Serializer class to Codec, created two sub-interfaces called … Apr 3, 2013
LICENSE.txt Fix Async Streams timeout behaviour Sep 4, 2015 update documentation for running tests to explicitly mention required… Aug 26, 2016
build.gradle JAVA-2348: Use ORG_GRADLE_PROJECT-prefixed environment variable to pa… Jan 20, 2017 Created a check in the build to let us turn off running @Slow tests. … Sep 10, 2014
gradlew Added Gradle wrapper support, idea configuration from gradle, and che… Nov 6, 2013
gradlew.bat added gradlew.bat for windows users. Dec 3, 2013
settings.gradle Normalize copyright headers Jul 22, 2015
settings.jar Applied standards across codecase: Oct 9, 2013

Release Notes

Release notes are available here.

API Documentation:

Javadoc for all major and minor releases is available here.

Support / Feedback

For issues with, questions about, or feedback for the MongoDB Java driver, please look into our support channels. Please do not email any of the Java driver developers directly with issues or questions - you're more likely to get an answer on the mongodb-user list on Google Groups.

At a minimum, please include in your description the exact version of the driver that you are using. If you are having connectivity issues, it's often also useful to paste in the line of code where you construct the MongoClient instance, along with the values of all parameters that you pass to the constructor. You should also check your application logs for any connectivity-related exceptions and post those as well.

Bugs / Feature Requests

Think you’ve found a bug? Want to see a new feature in the Java driver? Please open a case in our issue management tool, JIRA:

Bug reports in JIRA for the driver and the Core Server (i.e. SERVER) project are public.

If you’ve identified a security vulnerability in a driver or any other MongoDB project, please report it according to the instructions here.


Major increments (such as 2.x -> 3.x) will occur when break changes are being made to the public API. All methods and classes removed in a major release will have been deprecated in a prior release of the previous major release branch, and/or otherwise called out in the release notes.

Minor 3.x increments (such as 3.1, 3.2, etc) will occur when non-trivial new functionality is added or significant enhancements or bug fixes occur that may have behavioral changes that may affect some edge cases (such as dependence on behavior resulting from a bug). An example of an enhancement is a method or class added to support new functionality added to the MongoDB server. Minor releases will almost always be binary compatible with prior minor releases from the same major release branch, exept as noted below.

Patch 3.x.y increments (such as 3.0.0 -> 3.0.1, 3.1.1 -> 3.1.2, etc) will occur for bug fixes only and will always be binary compitible with prior patch releases of the same minor release branch.


APIs marked with the @Beta annotation at the class or method level are subject to change. They can be modified in any way, or even removed, at any time. If your code is a library itself (i.e. it is used on the CLASSPATH of users outside your own control), you should not use beta APIs, unless you repackage them (e.g. by using shading, etc).


APIs marked with the @Deprecated annotation at the class or method level will remain supported until the next major release but it is recommended to stop using them.


All code inside the com.mongodb.internal.* packages is considered private API and should not be relied upon at all. It can change at any time.


Binaries and dependency information for Maven, Gradle, Ivy and others can be found at

Example for Maven:


For an all-in-one jar (which embeds the core driver and bson):


Snapshot builds are also published regulary via Sonatype.

Example for Maven:


For binaries containing the asynchronous API, see the driver-async README.


To build and test the driver:

$ git clone
$ cd mongo-java-driver
$ ./gradlew check

The test suite requires mongod to be running with enableTestCommands, which may be set with the --setParameter enableTestCommands=1 command-line parameter.

Build status:

Build Status | Build Status



Additional contributors can be found here.


YourKit is supporting this open source project with its YourKit Java Profiler.

JetBrains is supporting this open source project with:

Intellij IDEA