dotConnect for MongoDB Documentation
Devart.Data.MongoDB Namespace / MongoDBConnectionStringBuilder Class
Fields Properties Methods


On this page
    MongoDBConnectionStringBuilder Class Members
    On this page

    The following tables list the members exposed by MongoDBConnectionStringBuilder.

    Public Constructors
     NameDescription
    Public ConstructorOverloaded. Initializes a new instance of the MongoDBConnectionStringBuilder class.  
    Top
    Public Properties
     NameDescription
    Public PropertyGets or sets additional servers of a replica set or sharded cluster in the host[:port],host[:port] format. The default value is an empty string.  
    Public PropertyGets or sets a value indicating whether, with Sql Engine=true, INSERT and UPDATE statements may write fields that the collection or document does not have; false raises an error. The default value is true.  
    Public PropertyGets or sets the database in which the user is defined (authSource option). The default value is an empty string.  
    Public PropertyGets or sets a value indicating whether, with Sql Engine=true, embedded documents and arrays are returned as one column with their JSON instead of a column per nested field. The default value is false.  
    Public PropertyGets or sets the connection format (see MongoDBConnectionFormat): Standard (mongodb://) or DnsSeedList (mongodb+srv://). The default value is MongoDBConnectionFormat.Standard.  
    Public PropertyGets or sets the time, in seconds, during which a pooled connection is kept alive. The default value is 0.  
    Public PropertyGets or sets options of the MongoDB connection string URI in the name=value&name=value format, added after "?". The default value is an empty string.  
    Public Property (Inherited from System.Data.Common.DbConnectionStringBuilder)
    Public PropertyGets or sets the time, in seconds, to wait while trying to open a connection (server selection) before an error is generated; 0 uses the libmongoc default. The default value is 30.  
    Public Property (Inherited from System.Data.Common.DbConnectionStringBuilder)
    Public PropertyGets or sets a value indicating whether an INSERT or MongoDBLoader into a collection that does not exist creates it; false raises an error. The default value is false.  
    Public PropertyGets or sets the database the connection works with; with Sql Engine=true its collections are the tables. The default value is an empty string.  
    Public PropertyGets or sets the Kind of DateTime values read from the server, Utc or Local; a DateTime of Unspecified kind is written as this kind. The default value is System.DateTimeKind.Utc.  
    Public PropertyGets or sets how DateTimeOffset values are stored (see MongoDBDateTimeOffsetFormat). The default value is MongoDBDateTimeOffsetFormat.DateTime.  
    Public PropertyGets or sets the .NET type of Decimal128 values (see MongoDBDecimal128Mapping): String (the exact value), Decimal, or Double. The default value is MongoDBDecimal128Mapping.String.  
    Public PropertyGets or sets the number of documents read to determine the fields of a collection. The default value is 100.  
    Public PropertyGets or sets a value indicating whether the connection is automatically enlisted in the current transaction context (TransactionScope). The default value is true.  
    Public PropertyGets or sets how Guid values are stored (see MongoDBGuidFormat). The default value is MongoDBGuidFormat.Uuid.  
    Public PropertyGets or sets the name or IP address of the MongoDB server; with Connection Format=DnsSeedList, the host name of its DNS SRV record. The default value is an empty string, which means localhost.  
    Public PropertySpecifies a data source-specific command that should be executed immediately after establishing the connection. (Inherited from Devart.Common.DbConnectionStringBuilder)
    Public Property (Inherited from System.Data.Common.DbConnectionStringBuilder)
    Public Property (Inherited from System.Data.Common.DbConnectionStringBuilder)
    Public PropertyOverridden. Gets or sets the value of the specified keyword. Setting a null reference (Nothing in Visual Basic) removes the keyword; an unsupported keyword throws System.NotSupportedException.  
    Public PropertyGets or sets the embedded documents and arrays that, with Sql Engine=true, are returned as one column with their JSON: a semicolon-separated list of collection.field items. The default value is an empty string.  
    Public PropertyOverridden. Gets a collection of all keywords supported by the builder.  
    Public PropertyGets or sets the license key. The default value is an empty string.  
    Public PropertyGets or sets the maximum number of connections in the pool. The default value is 100.  
    Public PropertyGets or sets the minimum number of connections in the pool. The default value is 0.  
    Public PropertyGets or sets the folder that contains libmongoc-1.0.dll, libbson-1.0.dll, and sqlite3.dll; it is searched before the provider assembly folder, the application folder, and the installation folder. The default value is an empty string.  
    Public PropertyGets or sets the password for the connection. The default value is an empty string.  
    Public PropertyGets or sets a value indicating whether security-sensitive information, such as the password, is returned as part of the connection string after the connection has been opened. The default value is false.  
    Public PropertyGets or sets a value indicating whether the connection is taken from a connection pool. The default value is true.  
    Public PropertyGets or sets the port the MongoDB server listens on. The default value is 27017.  
    Public PropertyGets or sets how a data reader returns documents in the native mode (Sql Engine=false): a column per field or the whole document as one value (see MongoDBReaderType). The default value is MongoDBReaderType.Default.  
    Public PropertyGets or sets the name of the replica set (replicaSet option). The default value is an empty string.  
    Public PropertySpecifies a data source-specific command that should be executed immediately after first establishing the connection. Unlike InitializationCommand, this command is not executed when a connection is taken from the pool. (Inherited from Devart.Common.DbConnectionStringBuilder)
    Public PropertyGets or sets the validation mode of the collection schema created by CREATE TABLE and EF Core EnsureCreated (see MongoDBSchemaValidationMode). The default value is MongoDBSchemaValidationMode.Off.  
    Public PropertyGets or sets the maximum time, in seconds, that one attempt to connect a socket to a server can take; it is limited by Connection Timeout, and 0 uses the libmongoc default. The default value is 10.  
    Public PropertyGets or sets a value indicating whether commands are SQL statements over collections as tables (true) or MongoDB database commands in JSON (false). The default value is true.  
    Public PropertyGets or sets the PEM file of the certificate authority that validates the server certificate (tlsCAFile); used with SSL Mode=Require. Not supported on Windows: Open throws MongoDBException; import the CA certificate into the Windows certificate store instead. The default value is an empty string.  
    Public PropertyGets or sets the PEM file with the client certificate and its private key (tlsCertificateKeyFile); used with SSL Mode=Require. On Windows the key must be an unencrypted PKCS#1 RSA key (-----BEGIN RSA PRIVATE KEY-----); for another key format Open throws MongoDBException. The default value is an empty string.  
    Public PropertyGets or sets the TLS/SSL mode of the connection (see MongoDBSslMode): Disable or Require. The default value is MongoDBSslMode.Disable.  
    Public PropertyGets or sets the password of the private key in the SSL Cert file (tlsCertificateKeyFilePassword); used with SSL Mode=Require. Not supported on Windows: Open throws MongoDBException. The default value is an empty string.  
    Public PropertyGets or sets how transactions work on a standalone server, which does not support them (see MongoDBTransactionMode): IfSupported runs commands immediately without atomicity; Required raises an error. The default value is MongoDBTransactionMode.IfSupported.  
    Public PropertyGets or sets a value indicating whether, with SSL Mode=Require, the server certificate is accepted without validating its chain and host name. The default value is false.  
    Public PropertyGets or sets a MongoDB connection string URI (mongodb:// or mongodb+srv://) used as the base of the connection; User Id, Password, Host, Port, and Additional Servers replace its parts, other keywords add options. Port and Additional Servers replace the hosts of Url only together with Host: with Url set and Host empty, setting Port or Additional Servers throws System.ArgumentException when the connection string is parsed, and so does Password without User Id. The default value is an empty string.  
    Public PropertyGets or sets the user name for the connection. The default value is an empty string.  
    Public PropertyOverridden. Gets a collection of the values of all supported keywords.  
    Top
    Public Methods
     NameDescription
    Public Method (Inherited from System.Data.Common.DbConnectionStringBuilder)
    Public MethodOverridden. Clears the contents of the builder and resets all properties to their default values.  
    Public MethodOverridden. Returns true if the builder supports the specified keyword (including its synonyms).  
    Public MethodOverloaded. Overridden. Returns a value indicating whether this MongoDBConnectionStringBuilder has same parameters as given DbConnectionStringBuilder.  
    Public MethodOverridden. Removes the parameter with the specified keyword and resets the corresponding property to its default value. Returns true if the keyword is supported.  
    Public MethodOverridden. Returns true if the specified keyword is set in the connection string.  
    Public Method (Inherited from System.Data.Common.DbConnectionStringBuilder)
    Public MethodOverridden. Gets the value of the specified keyword. Returns false if the keyword is not supported.  
    Top
    Protected Methods
     NameDescription
    Protected MethodOverridden. Fills the collection of property descriptors that represent the connection string parameters at design time.  
    Protected MethodOverloaded.  (Inherited from Devart.Common.DbConnectionStringBuilder)
    Top
    See Also