MongoClient

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.

Constructors

this
this(string host, ushort port)
Undocumented in source.
this
this(string url)

Initializes a MongoDB client using a URL.

this
this(MongoClientSettings settings)
Undocumented in source.

Members

Functions

cleanupConnections
void cleanupConnections()

Disconnects all currently unused connections to the server.

getCollection
MongoCollection getCollection(string path)

Accesses a collection using an absolute path.

getDatabase
MongoDatabase getDatabase(string dbName)

Returns an object representing the specified database.

getDatabases
auto getDatabases()

Return a handle to all databases of the server.

lockConnection
auto lockConnection()
Undocumented in source. Be warned that the author may not have intended to support it.

Meta