Registry / database / mongodb-driver

mongodb-driver

JSON →
library3.12.14javamavenunverified

This artifact is no longer maintained; use mongodb-driver-sync for the modern driver or mongodb-driver-legacy for the legacy API.

<dependency> <groupId>org.mongodb</groupId> <artifactId>mongodb-driver</artifactId> <version>3.12.14</version> </dependency>
INSTALL
IMPORT
SIG · MONGODB-DRIVER
M
mongodb-driver
databasejavav3.12.14
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

MongoClient
com.mongodb.MongoClient

Minimal example showing how to connect to a MongoDB instance using the legacy driver.

import com.mongodb.MongoClient; import com.mongodb.client.MongoDatabase; public class Quickstart { public static void main(String[] args) { MongoClient mongoClient = new MongoClient("localhost", 27017); MongoDatabase database = mongoClient.getDatabase("mydb"); System.out.println("Connected to database: " + database.getName()); mongoClient.close(); } }
Debug
Known issues
breakingThis driver is deprecated and no longer maintained. Use mongodb-driver-sync for new projects.
fix
Replace dependency with org.mongodb:mongodb-driver-sync and update imports to com.mongodb.client.MongoClients.
affects: >=3.0.0
Upgrade
Version history
3.12.14latest on Maven
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
6
Resources
mongodb-driver — mvn dependency:get mongodb-driver · libregistry