talira

MongoDB Java Driver

MongoDB's official drivers for Java, Kotlin and Scala

open sourceApache-2.0free

The MongoDB Java Driver repository holds MongoDB's official drivers for the JVM: the synchronous Java driver (mongodb-driver-sync), a Reactive Streams driver, Kotlin coroutine and sync drivers, a Scala driver, and the BSON libraries they share. It's how a JVM application connects to MongoDB. The old all-in-one mongo-java-driver artifact stops at version 3.12.14 (2023); the current 5.x driver is published as mongodb-driver-sync and the other artifacts.

Problems it solves

  • connect my Java application to a MongoDB database
  • query MongoDB from Kotlin with coroutines
  • the mongo-java-driver artifact stopped at 3.12: which MongoDB Java driver do I use now

Features

  • synchronous Java driver (mongodb-driver-sync)
  • Reactive Streams driver
  • Kotlin coroutine and sync drivers, and a Scala driver
  • shared BSON libraries, including Kotlin and Scala codecs

Limitations

  • APIs marked @Alpha or @Beta may change or be removed in any release1

Alternatives

The same job

These do what MongoDB Java Driver does.

  1. PostgreSQL JDBC Driver The open source JDBC driver for PostgreSQL, in pure Java

Compare MongoDB Java Driver with the top 3