GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - mongodb/mongo-java-driver: The official MongoDB drivers for Java, Kotlin, and Scala

BranchesTags
Open more actions menu

Latest commit

 

History

8,904 Commits
8,904 Commits

Folders and files

NameName
Last commit message
Last commit date
.agents
.agents
 
 
.claude
.claude
 
 
.evergreen
.evergreen
 
 
.github
.github
 
 
bom
bom
 
 
bson-kotlin
bson-kotlin
 
 
bson-kotlinx
bson-kotlinx
 
 
bson-record-codec
bson-record-codec
 
 
bson-scala
bson-scala
 
 
bson
bson
 
 
buildSrc
buildSrc
 
 
config
config
 
 
driver-benchmarks
driver-benchmarks
 
 
driver-core
driver-core
 
 
driver-kotlin-coroutine
driver-kotlin-coroutine
 
 
driver-kotlin-extensions
driver-kotlin-extensions
 
 
driver-kotlin-sync
driver-kotlin-sync
 
 
driver-lambda
driver-lambda
 
 
driver-legacy
driver-legacy
 
 
driver-reactive-streams
driver-reactive-streams
 
 
driver-scala
driver-scala
 
 
driver-sync
driver-sync
 
 
graalvm-native-image-app
graalvm-native-image-app
 
 
gradle
gradle
 
 
mongodb-crypt
mongodb-crypt
 
 
scripts
scripts
 
 
testing
testing
 
 
.editorconfig
.editorconfig
 
 
.git-blame-ignore-revs
.git-blame-ignore-revs
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
.gitmodules
.gitmodules
 
 
AGENTS.md
AGENTS.md
 
 
CLAUDE.md
CLAUDE.md
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
LICENSE.txt
LICENSE.txt
 
 
README.md
README.md
 
 
THIRD-PARTY-NOTICES
THIRD-PARTY-NOTICES
 
 
build.gradle.kts
build.gradle.kts
 
 
gradle.properties
gradle.properties
 
 
gradlew
gradlew
 
 
gradlew.bat
gradlew.bat
 
 
java-security-ocsp-property
java-security-ocsp-property
 
 
sbom.json
sbom.json
 
 
settings.gradle.kts
settings.gradle.kts
 
 

Repository files navigation

Release Notes

Release notes are available here.

Documentation

Reference and API documentation for the Java driver is available here.

Reference and API documentation for the Kotlin driver is available here.

Reference and API documentation for the Scala driver is available here.

Tutorials / Training

For tutorials on how to use the MongoDB JVM Drivers, please reference MongoDB University. Additional tutorials, videos, and code examples using both the Java Driver and the Kotlin Driver can also be found in the MongoDB Developer Center.

Support / Feedback

For issues with, questions about, or feedback for the MongoDB Java, Kotlin, and Scala drivers, please look into our support channels. Please do not email any of the driver developers directly with issues or questions - you're more likely to get an answer on the MongoDB Community Forums or StackOverflow.

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 in the Java, Kotlin, or Scala drivers? Want to see a new feature in the drivers? Please open a case in our issue management tool, JIRA:

  • Create an account and login.
  • Navigate to the JAVA project.
  • Click Create Issue - Please provide as much information as possible about the issue type, which driver you are using, and how to reproduce your issue.

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.

Versioning

We follow semantic versioning when releasing.

@Alpha

APIs marked with the @Alpha annotation are in the early stages of development, subject to incompatible changes, or even removal, in a future release and may lack some intended features. An APIs bearing @Alpha annotation may contain known issues affecting functionality, performance, and stability. They are also exempt from any compatibility guarantees made by its containing library.

It is inadvisable for applications to use Alpha APIs in production environments or for libraries (which get included on users' CLASSPATHs, outside the library developers' control) to depend on these APIs. Alpha APIs are intended for experimental purposes only.

@Beta

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).

@Deprecated

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.

com.mongodb.internal.*

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

Binaries and dependency information for Maven, Gradle, Ivy and others can be found at https://central.sonatype.com/search.

Example for Maven:

<dependency>
    <groupId>org.mongodb</groupId>
    <artifactId>mongodb-driver-sync</artifactId>
    <version>x.y.z</version>
</dependency>

Snapshot builds are also published regularly via Sonatype.

Example for Maven:

<repositories>
    <repository>
        <name>Central Portal Snapshots</name>
        <id>central-portal-snapshots</id>
        <url>https://central.sonatype.com/repository/maven-snapshots/</url>
        <releases>
            <enabled>false</enabled>
        </releases>
        <snapshots>
            <enabled>true</enabled>
        </snapshots>
    </repository>
</repositories>

Build

Java 17+ and git is required to build and compile the source. To build and test the driver:

$ git clone --recurse-submodules https://github.com/mongodb/mongo-java-driver.git
$ 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:

$ mkdir -p data/db
$ mongod --dbpath ./data/db --logpath ./data/mongod.log --port 27017 --logappend --fork --setParameter enableTestCommands=1

If you encounter "Too many open files" errors when running the tests then you will need to increase the number of available file descriptors prior to starting mongod as described in https://www.mongodb.com/docs/manual/reference/ulimit/

AI Agent Configuration

This repository uses agentskills.io conventions for AI coding agent instructions. AGENTS.md is the canonical source of truth — tool-specific files like CLAUDE.md are generated references.

Adding a nested AGENTS.md

  1. Create an AGENTS.md in the target directory.
  2. Run scripts/sync-claude-md.sh to generate the companion CLAUDE.md. This script should be run before staging — it creates/removes CLAUDE.md files to match staged AGENTS.md changes and maintains the .claude/skills symlink.
  3. Stage and commit both files.

IntelliJ IDEA

A couple of manual configuration steps are required to run the code in IntelliJ:

  • Java 17+ is required to build and compile the source.

  • Error: java: cannot find symbol: class SNIHostName location: package javax.net.ssl
    Fix: Settings/Preferences > Build, Execution, Deployment > Compiler > Java Compiler - untick "Use '--release' option for cross-compilation (Java 9 and later)"

  • Error: java: package com.mongodb.internal.build does not exist
    Fixes: Any of the following:

    • Run the generateBuildConfig task: eg: ./gradlew generateBuildConfig or via Gradle > driver-core > Tasks > buildconfig > generateBuildConfig
    • Set generateBuildConfig to execute Before Build. via Gradle > Tasks > buildconfig > right click generateBuildConfig - click on "Execute Before Build"
    • Delegate all build actions to Gradle: Settings/Preferences > Build, Execution, Deployment > Build Tools > Gradle > Build and run using/Run tests using - select "Gradle"

About

The official MongoDB drivers for Java, Kotlin, and Scala

www.mongodb.com/docs/drivers/java/sync/current/

Topics

databasejavajava-libraryjvmkotlinkotlin-coroutineskotlin-librarymongodbscala

Resources

Readme
Apache-2.0 license

Contributing

Contributing
Activity
Custom properties

Stars

2.7k stars

Watchers

205 watching

Forks

1.5k forks
Report repository

Releases

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.