License
Subject to the terms of the MIT license, as written in the included LICENSE.txt file.
MongoDB client connection settings.
Describes a vibe.d supported authentication mechanism to use on client connection to a MongoDB server.
Specifies a level of isolation for read operations. For example, you can use read concern to only read data that has propagated to a majority of nodes in a replica set.
string levelThe level of the read concern.LevelDetermines which replica set members are acceptable for read operations.
Compression algorithm identifier for OP_COMPRESSED wire protocol messages.
ushort defaultPortGets the default port used for MongoDB connectionsstring usernameIf 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 toostring digestThe password hashed as MongoDB digest as returned by makeDigest.string passwordThe raw password, needed for SCRAM-SHA-256 which does not use the MD5 digest. Stored alongside digest for backward compatibility.uint maxConnectionsAmount of maximum simultaneous connections to have open at the same time.MongoHost[] hostsMongoDB hosts to try to connect to.string databaseDefault auth database to operate on, otherwise operating on special "admin" database for all MongoDB authentication commands.string replicaSetSpecifies the name of the replica set, if the mongod is a member of a replica set. When set, the driver validates that any connected server belongs to this replica set and discovers the primary thr...ReadPreference readPreferenceSpecifies the read preference mode for this connection.long localThresholdMSUpper bound on the acceptable latency window for nearest server selection. Servers within (fastest RTT + localThresholdMS) are eligible. Default: 15ms per MongoDB spec.long maxStalenessSecondsMaximum replication lag (in seconds) for a secondary to be eligible. -1 means no max staleness check. Minimum allowed value is 90 seconds.ReadConcern readConcernSpecifies the default read concern level for read operations.bool safeAutomatically check for errors when operating on collections and throw a MongoDBException in case of errors.Bson wRequests 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 maj...long wTimeoutMSTime limit for the w option to prevent write operations from blocking indefinitely.bool fsyncbool journalRequests acknowledgment that write operations have been written to the [on-disk journal](https://docs.mongodb.com/manual/core/journaling/).Duration connectTimeoutThe time to attempt a connection before timing out.Duration socketTimeoutThe time to attempt a send or receive on a socket before the attempt times out.bool sslEnables or disables TLS/SSL for the connection.bool sslverifycertificateCan be set to false to disable TLS peer validation to allow self signed certificates.string sslPEMKeyFilePath to a certificate with private key and certificate chain to connect with.string sslCAFilePath to a certificate authority file for verifying the remote certificate.string authSourceSpecify 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`...MongoAuthMechanism authMechanismUse the given authentication mechanism when connecting to the server. If unsupported by the server, throw a MongoAuthException.string[] authMechanismPropertiesSpecify properties for the specified authMechanism as a comma-separated list of colon-separated key-value pairs.string appNameApplication name for the connection information when connected.Compressor[] compressorsOrdered list of compression algorithms the client is willing to use. The server picks the first one it supports.int zlibCompressionLevelCompression level for zlib (1-9). -1 means default (level 6).string makeDigest(string username, string password) static pure @safeGenerates a digest string which can be used for authentication by setting the username and digest members.void authenticatePassword(string username, string password) @safeSets the username and the digest string in this MongoClientSettings instance.void authenticateSSL(string username, string sslPEMKeyFile, string sslCAFile = null) @safeSets ssl, the username, the PEM key file and the trusted CA file in this MongoClientSettings instance.string getAuthDatabase() @safe @nogc nothrow pure const returnResolves the database to run authentication commands on. (authSource if set, otherwise the URI's database if set, otherwise "admin")bool parseMongoDBUrl(out MongoClientSettings cfg, string url) @safeParses the given string as a mongodb URL. The URL must be in the form documented at http://www.mongodb.org/display/DOCS/Connections which is:MongoHost parseHostPort(string hostPort) @safe pure nothrowParses a "host:port" string into a MongoHost. Returns MongoHost.init if the string cannot be parsed.