appname |
string |
MongoDB 3.4+ has the ability to annotate connections with metadata
provided by the connecting client. This metadata is included in the
server's logs upon establishing a connection and also recorded in
slow query logs when database profiling is enabled.
This option may be used to specify an application name, which will
be included in the metadata. The value cannot exceed 128 characters
in length.
|
authMechanism |
string |
The authentication mechanism that MongoDB will use to authenticate
the connection. For additional details and a list of supported
values, see
» Authentication Options
in the MongoDB manual.
|
authMechanismProperties |
array |
Properties for the selected authentication mechanism. For additional
details and a list of supported properties, see the
» Driver Authentication Specification.
Note:
When not specified in the URI string, this option is expressed as
an array of key/value pairs. The keys and values in this array
should be strings.
|
authSource |
string |
The database name associated with the user's credentials. Defaults
to the database component of the connection URI.
For authentication mechanisms that delegate credential storage to
other services (e.g. GSSAPI), this should be
"$external".
|
canonicalizeHostname |
boolean |
If TRUE , the driver will resolve the real hostname for the server
IP address before authenticating via SASL. Some underlying GSSAPI
layers already do this, but the functionality may be disabled in
their config (e.g. krb.conf). Defaults to
FALSE .
This option is a deprecated alias for the
"CANONICALIZE_HOST_NAME" property of the
"authMechanismProperties" URI option.
|
connectTimeoutMS |
integer |
The time in milliseconds to attempt a connection before timing out.
Defaults to 10,000 milliseconds.
|
gssapiServiceName |
string |
Set the Kerberos service name when connecting to Kerberized MongoDB
instances. This value must match the service name set on MongoDB
instances (i.e.
» saslServiceName
server parameter). Defaults to "mongodb".
This option is a deprecated alias for the
"SERVICE_NAME" property of the
"authMechanismProperties" URI option.
|
heartbeatFrequencyMS |
integer |
Specifies the interval in milliseconds between the driver's checks
of the MongoDB topology, counted from the end of the previous check
until the beginning of the next one. Defaults to 60,000
milliseconds.
Per the
» Server Discovery and Monitoring Specification,
this value cannot be less than 500 milliseconds.
|
journal |
boolean |
Corresponds to the write concern's journal
parameter. If TRUE , writes will require acknowledgement from
MongoDB that the operation has been written to the journal. For
details, see MongoDB\Driver\WriteConcern.
|
localThresholdMS |
integer |
The size in milliseconds of the latency window for selecting among
multiple suitable MongoDB instances while resolving a read
preference. Defaults to 15 milliseconds.
|
maxStalenessSeconds |
integer |
Corresponds to the read preference's
"maxStalenessSeconds". Specifies, in seconds, how
stale a secondary can be before the client stops using it for read
operations. By default, there is no maximum staleness and clients
will not consider a secondary's lag when choosing where to direct a
read operation. For details, see
MongoDB\Driver\ReadPreference.
If specified, the max staleness must be a signed 32-bit integer
greater than or equal to
MongoDB\Driver\ReadPreference::SMALLEST_MAX_STALENESS_SECONDS
(i.e. 90 seconds).
|
password |
string |
The password for the user being authenticated. This option is useful
if the password contains special characters, which would otherwise
need to be URL encoded for the connection URI.
|
readConcernLevel |
string |
Corresponds to the read concern's level
parameter. Specifies the level of read isolation. For details, see
MongoDB\Driver\ReadConcern.
|
readPreference |
string |
Corresponds to the read preferences's mode
parameter. Defaults to "primary". For
details, see MongoDB\Driver\ReadPreference.
|
readPreferenceTags |
array |
Corresponds to the read preferences's tagSets
parameter. Tag sets allow you to target read operations to specific
members of a replica set. For details, see
MongoDB\Driver\ReadPreference.
Note:
When not specified in the URI string, this option is expressed as
an array consistent with the format expected by
MongoDB\Driver\ReadPreference::__construct().
|
replicaSet |
string |
Specifies the name of the replica set.
|
safe |
boolean |
Specifies 1 for the write concern if TRUE , or
0 if FALSE For details, see
MongoDB\Driver\WriteConcern.
This option is deprecated and should not be used.
|
serverSelectionTimeoutMS |
integer |
Specifies how long in milliseconds to block for server selection
before throwing an exception. Defaults to 30,000 milliseconds.
|
serverSelectionTryOnce |
boolean |
When TRUE , instructs the driver to scan the MongoDB deployment
exactly once after server selection fails and then either select a
server or raise an error. When FALSE , the driver blocks and
searches for a server up to the
"serverSelectionTimeoutMS" value. Defaults to
TRUE .
|
slaveOk |
boolean |
Specifies "secondaryPreferred" for the read
preference mode if TRUE . For details, see
MongoDB\Driver\ReadPreference.
This option is deprecated and should not be used.
|
socketCheckIntervalMS |
integer |
If a socket has not been used recently, the driver must check it via
an isMaster command before using it for any
operation. Defaults to 5,000 milliseconds.
|
socketTimeoutMS |
integer |
The time in milliseconds to attempt a send or receive on a socket
before timing out. Defaults to 300,000 milliseconds (i.e. five
minutes).
|
ssl |
boolean |
Initiates the connection with TLS/SSL if TRUE . Defaults to
FALSE .
|
username |
string |
The username for the user being authenticated. This option is useful
if the username contains special characters, which would otherwise
need to be URL encoded for the connection URI.
|
w |
integer|string |
Corresponds to the write concern's w
parameter. For details, see
MongoDB\Driver\WriteConcern.
|
wTimeoutMS |
integer|string |
Corresponds to the write concern's wtimeout
parameter. Specifies a time limit, in milliseconds, for the write
concern. For details, see
MongoDB\Driver\WriteConcern.
|