vibe.db.mongo.client

MongoClient class doing connection management. Usually this is a main entry point for client code.

Types 1

Represents a connection to a MongoDB server.

Note that this class uses a ConnectionPool internally to create and reuse network connections to the server as necessary. It should be reused for all fibers in a thread for optimum performance in high concurrency scenarios.

Methods
ReadPreference readPreference() @property @safe constReturns the read preference configured for this client.
ReadConcern readConcern() @safe constReturns the read concern configured for this client.
void cleanupConnections() @safeDisconnects all currently unused connections to the server.
MongoCollection getCollection(string path) @safeAccesses a collection using an absolute path.
MongoDatabase getDatabase(string dbName) @safeReturns an object representing the specified database.
auto getDatabases()() @safeReturn a handle to all databases of the server.
LockedConnection!MongoConnection lockConnection() @safe
Constructors
this(string host, ushort port)
this(string url)Initializes a MongoDB client using a URL.