MongoDB Java Driver
Introduction
Welcome to the documentation site for the Java Driver, the official MongoDB driver for synchronous Java applications. Follow the Quick Start guide to learn how to add the driver to your project by using Maven or Gradle and how to set up a runnable app.
If your Java application requires asynchronous stream processing, use the Reactive Streams Driver which uses Reactive Streams to make non-blocking calls to MongoDB.
Connect to a Compatible MongoDB Deployment
You can use the Java Driver to connect to MongoDB deployments running on one of the following hosted services or editions:
MongoDB Atlas: the fully managed service for MongoDB deployments in the cloud
MongoDB Enterprise: the subscription-based, self-managed version of MongoDB
MongoDB Community: the source-available, free-to-use, and self-managed version of MongoDB
Quick Start
Learn how to establish a connection to MongoDB Atlas and begin working with data in the Quick Start section.
Quick Reference
See driver syntax examples for common MongoDB commands in the Quick Reference section.
What's New
For a list of new features and changes in each version, see the What's New section.
Usage Examples
For fully runnable code snippets and explanations for common methods, see the Usage Examples section.
Fundamentals
Learn how to perform the following tasks using the Java driver in the Fundamentals section:
API Documentation
The MongoDB Java driver API documentation contains several libraries organized by functionality. For detailed information about classes and methods in each library, see the following table for their descriptions and links to the API documentation.
Library | Description |
---|---|
Base BSON classes | |
Classes that support records | |
Shared core classes | |
Modern API | |
Legacy API |
FAQ
For answers to commonly asked questions about the MongoDB Java Driver, see the Frequently Asked Questions (FAQ) section.
Connection Troubleshooting
For solutions to some issues you might see when connecting to a MongoDB deployment while using the MongoDB Java Driver, see Connection Troubleshooting.
Issues & Help
Learn how to report bugs, contribute to the driver, and find additional resources for asking questions and receiving help in the Issues & Help section.
Driver Integrations
Learn more about tools and frameworks that you can use together with Java Driver in the Driver Integrations section.
Compatibility
For the compatibility charts that show the recommended Java Driver version for each MongoDB Server version, see the Compatibility section.
Upgrade Driver Versions
Learn what changes you may need to make to your application to upgrade driver versions in the Upgrade Driver Versions section.
Migrate from the Legacy API
Learn what changes you may need to make to your application to migrate from the legacy API to the current API in the Migrate from the Legacy API section.
Learn
Visit the Developer Hub and MongoDB University to learn more about the MongoDB Java driver.
Developer Hub
The Developer Hub provides tutorials and social engagement for developers.
To learn how to use MongoDB features with the Java driver, see the How To's and Articles page.
To ask questions and engage in discussions with fellow developers using the Java Driver, see the forums page.
MongoDB University
MongoDB University provides free courses to teach everyone how to use MongoDB.
Take the free online course taught by MongoDB instructors
Learn the essentials of Java application development with MongoDB. |