Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
297 lines (200 sloc) 7.82 KB
.. _java-language-center:
Java MongoDB Driver
.. default-domain:: mongodb
.. contents:: On this page
:backlinks: none
:depth: 1
:class: twocols
Starting with the 3.0 release, the official MongoDB Java Driver
provides both synchronous and asynchronous interaction with MongoDB.
For the official MongoDB Java Driver reference, see:
- `MongoDB Java Driver Documentation
- `MongoDB Java Driver API Documentation
Driver Features
MongoDB Driver
An updated Java driver that includes the legacy API as well as a new
generic MongoCollection interface that complies with a new
cross-driver CRUD specification. For documentation on the Java
Driver, including the Getting Started guide, see `Java Driver
MongoDB Async Driver
A new asynchronous API that can leverage either Netty or Java 7's
AsynchronousSocketChannel for fast and non-blocking IO. For
documentation on the Async Java Driver,including the Getting Started
guide, see `Async Java Driver Documentation
BSON Library
A standalone BSON library with a new Codec infrastructure that you
can use to build high-performance encoders and decoders without
requiring an intermediate Map instance. For documentation on the
BSON Library, see `BSON Library
Core Driver
A new core library upon which both the MongoDB Driver and Async
Driver are both built. Users can use the new core library to build
alternative or experimental high-level APIs.
The recommended way to incorporate the driver into your project is with
a dependency management system. For more information, see
`MongoDB Java Driver <>`_.
If upgrading from an earlier version of the Java driver, see also
`What's New
Java Driver Compatibility
MongoDB Compatibility
.. include:: /includes/extracts/java-driver-compatibility-matrix-mongodb.rst
.. list-table::
:header-rows: 1
:stub-columns: 1
:class: compatibility
* - Java Driver Version
- MongoDB 2.4
- MongoDB 2.6
- MongoDB 3.0
- MongoDB 3.2
* - Version 3.2
- |checkmark|
- |checkmark|
- |checkmark|
- |checkmark|
* - Version 2.14
- |checkmark|
- |checkmark|
- |checkmark|
- |checkmark| [*]_
.. include:: /includes/extracts/java-driver-compatibility-full-mongodb.rst
.. include:: /includes/older-server-versions-unsupported.rst
.. [*] The 2.14 driver does not support all MongoDB 3.2 features (e.g.,
read concern); however, if you are currently on a version 2.x driver
and would like to run against MongoDB 3.2 but cannot upgrade to driver
version 3.2, use the 2.14 driver.
Language Compatibility
.. include:: /includes/extracts/java-driver-compatibility-matrix-language.rst
.. list-table::
:header-rows: 1
:stub-columns: 1
:class: compatibility
:widths: 40 20 20 20 20
* - Java Driver Version
- Java 5
- Java 6
- Java 7
- Java 8
* - Version 3.x
- |checkmark|
- |checkmark|
- |checkmark|
* - Versions 2.x
- |checkmark|
- |checkmark|
- |checkmark|
- |checkmark|
.. include:: /includes/extracts/java-driver-compatibility-full-language.rst
.. include:: /includes/unicode-checkmark.rst
Third Party Frameworks and Libraries
POJO Mappers
- `Morphia`_. Type-Safe Wrapper with DAO/Datastore abstractions.
- `Spring MongoDB`_. Provides Spring users with a familiar data access
features including rich POJO mapping.
- `Morphium`_. Feature-rich POJO Mapper including features like
declarative caching, cluster awareness, validation, partial updates
supports aggregation framework.
- `Mungbean`_ (w/clojure support).
- `DataNucleus JPA/JDO`_. JPA/JDO wrapper
- `lib-mongomapper`_. JavaBean Mapper (No annotations).
- `MongoJack`_. Uses jackson (annotations) to map to/from POJOs and has
a simple wrapper around ``DBCollection`` to simply this.
- `Kundera`_. JPA compliant ORM. Works with multiple datastores.
- `MongoFS <>`_. Enhanced file
storage library with support for file compression, encryption, and
Zip file expansion. Can be used on top of a GridFS-compatible bucket.
- `Jongo`_. Query in Java as in :program:`mongo` shell (using strings),
unmarshall results into Java objects (using Jackson)
- `MongoLink`_. Object Document Mapper (ODM.) Uses a plain java DSL for
mapping declaration.
- `Hibernate OGM <>`_. Provides Java
Persistence support for MongoDB.
- `Morphix <>`_. Lightweight,
easy-to-use POJO mapper, with object caching and lifecycle methods.
.. _`Morphia`:
.. _`Morphium`:
.. _`Mungbean`:
.. _`Spring MongoDB`:
.. _`DataNucleus JPA/JDO`:
.. _`lib-mongomapper`:
.. _`MongoJack`:
.. _`Kundera`:
.. _`Jongo`:
.. _`MongoLink`:
Code Generation
- `Sculptor`_. MongoDB-based DSL -> Java (code generator)
- `GuicyData`_. DSL -> Java generator with Guice integration.
.. _`Sculptor`:
.. _`GuicyData`:
- `mongo-queue-java <>`_.
Java message queue using MongoDB as a backend.
- `mongo-java-logging`_. A Java logging handler.
- `log4mongo`_. A log4j appender
- `Allanbank Asynchronous Java Driver`_
- `JDBC Driver for MongoDB`_
- `(Experimental, Type4) JDBC driver`_
- `Metamodel data exploration and querying library`_
- `Mongodb Java REST server`_ based on `Jetty`_
.. _`Allanbank Asynchronous Java Driver`:
.. _`log4mongo`:
.. _`mongo-java-logging`:
.. _`JDBC Driver for MongoDB`:
.. _`(Experimental, Type4) JDBC driver`:
.. _`Metamodel data exploration and querying library`:
.. _`Mongodb Java REST server`:
.. _`Jetty`:
.. _`Amdatu Mongo OSGi services for Mongo`:
- `monger <>`_
- `Congo Mongo <>`_
- `GMongo, a Groovy wrapper to the MongoDB Java driver
- `GMongo 0.5 Release Writeup
JavaScript (Rhino)
- `Horn of Mongo <>`_. A MongoDB
shell built on the Rhino JavaScript Engine for Java.
- `MongoDB-Rhino <>`_. A toolset
to provide full integration between the Rhino JavaScript engine for
the JVM and MongoDB. Uses the MongoDB Java driver.
Something went wrong with that request. Please try again.