Skip to content

MongoDB

virtualWinter edited this page Aug 31, 2025 · 1 revision

MongoDB

The storage-mongo module provides a simple way to interact with a MongoDB database.

Usage

// Initialize the MongoDB connection
Mongo mongo = new Mongo("mongodb://localhost:27017", "mydatabase");
mongo.init();
mongo.start();

// Get a collection
MongoCollection<MyObject> collection = mongo.getCollection(MyObject.class);

// ... perform operations on the collection

// Close the connection
mongo.end();

Clone this wiki locally