Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
117 lines (72 sloc) 3.17 KB
.. _java-language-center:
.. include:: /includes/unicode-checkmark.rst
Java MongoDB Driver
.. default-domain:: mongodb
.. contents:: On this page
:backlinks: none
:depth: 1
:class: twocols
The official MongoDB Java Driver providing both synchronous and asynchronous interaction with MongoDB.
- :java-docs-latest:`Tutorials <driver/tutorials/>`
- :java-docs-latest:`Usage Guide <driver/>`
- :java-docs-latest:`API Documentation <javadoc/overview-summary.html>`
- :java-docs-latest:`Changelog <whats-new/>`
- `Source Code <>`__
Take the free online course taught by MongoDB
.. list-table::
* - .. cssclass:: bordered-figure
.. figure:: /figures/M220J_hero.jpg
- `M220J: MongoDB for Java Developers <>`__
Learn the essentials of Java application development with MongoDB.
The recommended way to get started using one of the drivers in your project is with a dependency
management system. See
:java-docs-latest:`Installation Guide <driver/getting-started/installation/>`
Connect to MongoDB Atlas
To connect to a `MongoDB Atlas <>`_ cluster, use the `Atlas connection string <>`__ for your cluster:
.. code-block:: java
import com.mongodb.ConnectionString;
import com.mongodb.client.MongoClients;
import com.mongodb.client.MongoClient;
import com.mongodb.client.MongoDatabase;
import com.mongodb.MongoClientSettings;
// ...
ConnectionString connString = new ConnectionString(
MongoClientSettings settings = MongoClientSettings.builder()
MongoClient mongoClient = MongoClients.create(settings);
MongoDatabase database = mongoClient.getDatabase("test");
See :java-docs-latest:`Connect to MongoDB <driver/tutorials/connect-to-mongodb/>`
for more ways to connect.
MongoDB Compatibility
.. include:: /includes/mongodb-compatibility-table-java.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
.. include:: /includes/language-compatibility-table-java.rst
How to get help
- Join our `Google Group <!forum/mongodb-user>`__.
- Ask on `Stack Overflow <>`__.
- Visit our `Support Channels <>`__.
- See :java-docs-latest:`Issues & Help <issues-help/>`.
You can’t perform that action at this time.