Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

287 lines (191 sloc) 7.771 kB
.. _java-language-center:
===================
Java MongoDB Driver
===================
.. default-domain:: mongodb
.. admonition:: Java Driver 3.0 Released
For more information, see
`Introducing the 3.0 Java Driver <http://www.mongodb.com/blog/post/introducing-30-java-driver?jmp=docs>`_.
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 documentation, see the `MongoDB
Java Driver Documentation
<http://mongodb.github.io/mongo-java-driver/>`_. For the API
documentation, see `MongoDB Java Driver API Documentation
<http://api.mongodb.org/java/current>`_.
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
Documentation
<http://mongodb.github.io/mongo-java-driver/3.0/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
<http://mongodb.github.io/mongo-java-driver/3.0/driver-async/>`_.
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
<http://mongodb.github.io/mongo-java-driver/3.0/bson/>`_.
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.
Download/Upgrade
----------------
The recommended way to incorporate the driver into your project is with
a dependency management system. For more information, see
`MongoDB Java Driver <http://mongodb.github.io/mongo-java-driver/>`_.
If upgrading from an earlier version of the Java driver, see also
`What's New
<http://mongodb.github.io/mongo-java-driver/3.0/whats-new/upgrading/>`_.
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
* - Version 3.0
- |checkmark|
- |checkmark|
- |checkmark|
* - Version 2.13
- |checkmark|
- |checkmark|
- |checkmark|
.. include:: /includes/extracts/java-driver-compatibility-full-mongodb.rst
.. include:: /includes/older-server-versions-unsupported.rst
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.0
-
- |checkmark|
- |checkmark|
- |checkmark|
* - Versions 2.13
- |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 <http://dbuschman7.github.io/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 <http://www.hibernate.org/ogm/>`_. Provides Java
Persistence support for MongoDB.
- `Morphix <http://github.com/ParaPenguin/morphix>`_. Lightweight,
easy-to-use POJO mapper.
.. _`Morphia`:
https://github.com/mongodb/morphia
.. _`Morphium`:
http://sboesebeck.github.io/morphium/
.. _`Mungbean`:
http://github.com/jannehietamaki/mungbean
.. _`Spring MongoDB`: http://www.springsource.org/spring-data/mongodb
.. _`DataNucleus JPA/JDO`:
http://www.datanucleus.org/products/accessplatform_3_0/mongodb/support.html
.. _`lib-mongomapper`: https://github.com/dadastream/lib-mongomapper
.. _`MongoJack`:
http://mongojack.org/
.. _`Kundera`: http://kundera.googlecode.com
.. _`Jongo`: http://www.jongo.org/
.. _`MongoLink`: http://mongolink.org/
Code Generation
~~~~~~~~~~~~~~~
- `Sculptor`_. MongoDB-based DSL -> Java (code generator)
- `GuicyData`_. DSL -> Java generator with Guice integration.
.. _`Sculptor`:
http://java.dzone.com/articles/using-mongodb-sculptor
.. _`GuicyData`:
http://github.com/mattinsler/com.lowereast.guiceymongo/
Misc
~~~~
- `mongo-queue-java <https://github.com/gaillard/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`:
http://www.allanbank.com/mongodb-async-driver/
.. _`log4mongo`: http://code.google.com/p/log4mongo/
.. _`mongo-java-logging`: https://github.com/deftlabs/mongo-java-logging
.. _`JDBC Driver for MongoDB`:
http://www.unityjdbc.com/mongojdbc/
.. _`(Experimental, Type4) JDBC driver`:
http://github.com/erh/mongo-jdbc
.. _`Metamodel data exploration and querying library`:
http://metamodel.eobjects.org/download.html
.. _`Mongodb Java REST server`:
https://sites.google.com/site/mongodbjavarestserver/home
.. _`Jetty`: http://www.eclipse.org/jetty/
.. _`Amdatu Mongo OSGi services for Mongo`: http://amdatu.org/components/mongodb.html
Clojure
~~~~~~~
- `monger <https://github.com/michaelklishin/monger>`_
- `Congo Mongo <https://github.com/aboekhoff/congomongo>`_
Groovy
~~~~~~
- `GMongo, a Groovy wrapper to the MongoDB Java driver
<http://github.com/poiati/gmongo>`_
- `GMongo 0.5 Release Writeup
<http://blog.paulopoiati.com/2010/06/20/gmongo-0-5-released>`_
JavaScript (Rhino)
~~~~~~~~~~~~~~~~~~
- `Horn of Mongo <https://github.com/nlloyd/horn-of-mongo>`_. A MongoDB
shell built on the Rhino JavaScript Engine for Java.
- `MongoDB-Rhino <http://code.google.com/p/mongodb-rhino>`_. A toolset
to provide full integration between the Rhino JavaScript engine for
the JVM and MongoDB. Uses the MongoDB Java driver.
Hadoop
~~~~~~
:ref:`hadoop-connector`
Jump to Line
Something went wrong with that request. Please try again.