-
Notifications
You must be signed in to change notification settings - Fork 0
Setup and Installation
RezaNajafian edited this page Dec 8, 2025
·
1 revision
This page explains how to add MongoHelper to your project and create a basic MongoHelper instance.
MongoHelper depends on the official MongoDB Java driver. Add both to your build.
<dependencies>
<!-- MongoDB Java driver -->
<dependency>
<groupId>org.mongodb</groupId>
<artifactId>mongodb-driver-sync</artifactId>
<version>VERSION_HERE</version>
</dependency>
<!-- MongoHelper -->
<dependency>
<groupId>net.clydo</groupId>
<artifactId>mongohelper</artifactId>
<version>VERSION_HERE</version>
</dependency>
</dependencies>dependencies {
implementation("org.mongodb:mongodb-driver-sync:VERSION_HERE")
implementation("net.clydo:mongohelper:VERSION_HERE")
}Replace VERSION_HERE with the actual versions you publish or use.
Use the official MongoDB driver to create a MongoClient.
import com.mongodb.client.MongoClient;
import com.mongodb.client.MongoClients;
MongoClient client = MongoClients.create("mongodb://localhost:27017");You can customize the connection string and settings according to your environment.
MongoHelper is your main API surface. Create it using the static create method:
import net.clydo.mongo.MongoHelper;
// ...
MongoHelper mongoHelper = MongoHelper.create(client);Internally, this constructs a MongoHelperImpl which extends SchematicRegistry and is responsible for:
- Holding the
MongoClient - Managing registered schematics
- Building metadata and indexes
- Creating and caching
OperationsGroupinstances
From this point, you can register schematics and start performing operations on your models.