MongoDbConnector

In MongoDb connector class creates a connection with MongoDb by URI.

This class configures rules to connect to the database.

UUID representation is set to STANDARD.

You can directly get mapped documents to your custom objects, like this:

MongoCollection<User> collection = database.getCollection("users", User.class);

MongoDbConnector methods:

void disconnect() //closes connection
getMongoClient() //Gets MongoClient 
getMongoDatabase() //Gets MongoDatabase

Last updated