vibe.d beta banner
get vibe.d

Asynchronous I/O that doesn’t get in your way, written in D

Class MongoClientSettings

class MongoClientSettings ;


appName stringApplication name for the connection information when connected.
authMechanism MongoAuthMechanismUse the given authentication mechanism when connecting to the server. If unsupported by the server, throw a MongoAuthException.
authMechanismProperties string[]Specify properties for the specified authMechanism as a comma-separated list of colon-separated key-value pairs.
authSource stringSpecify the database name associated with the user's credentials. If authSource is unspecified, authSource defaults to the defaultauthdb specified in the connection string. If defaultauthdb is unspecified, then authSource defaults to admin.
connectTimeout core.time.DurationThe time to attempt a connection before timing out.
database stringDefault auth database to operate on, otherwise operating on special "admin" database for all MongoDB authentication commands.
defQueryFlags QueryFlags
digest stringThe password hashed as MongoDB digest as returned by makeDigest.
fsync bool
hosts MongoHost[]MongoDB hosts to try to connect to.
journal boolRequests acknowledgment that write operations have been written to the [on-disk journal](
maxConnections uintAmount of maximum simultaneous connections to have open at the same time.
replicaSet stringSpecifies the name of the replica set, if the mongod is a member of a replica set.
safe boolAutomatically check for errors when operating on collections and throw a MongoDBException, vibe,db,mongo,connection in case of errors.
socketTimeout core.time.DurationThe time to attempt a send or receive on a socket before the attempt times out.
ssl boolEnables or disables TLS/SSL for the connection.
sslCAFile stringPath to a certificate authority file for verifying the remote certificate.
sslPEMKeyFile stringPath to a certificate with private key and certificate chain to connect with.
sslverifycertificate boolCan be set to false to disable TLS peer validation to allow self signed certificates.
username stringIf set to non-empty string, use this username to try to authenticate with to the database. Only has an effect if digest or sslPEMKeyFile is set too
w BsonRequests acknowledgment that write operations have propagated to a specified number of mongod instances (number) or to mongod instances with specified tags (string) or "majority" for calculated majority.
wTimeoutMS longTime limit for the w option to prevent write operations from blocking indefinitely.


connectTimeoutMS[get, set] longThe time to attempt a connection before timing out.
socketTimeoutMS[get, set] longThe time to attempt a send or receive on a socket before the attempt times out.


authenticatePassword (username, password) Sets the username and the digest string in this MongoClientSettings instance.
authenticateSSL (username, sslPEMKeyFile, sslCAFile) Sets ssl, the username, the PEM key file and the trusted CA file in this MongoClientSettings instance.
getAuthDatabase () Resolves the database to run authentication commands on. (authSource if set, otherwise the URI's database if set, otherwise "admin")
makeDigest (username, password) Generates a digest string which can be used for authentication by setting the username and digest members.

See Also


Sönke Ludwig


© 2012-2016 Sönke Ludwig


Subject to the terms of the MIT license, as written in the included LICENSE.txt file.