Maslosoft Mangan API
Trait MongoClientOptions
MongoClientOptions
Direct Known Users
Maslosoft\Mangan\Annotations\ClientFlagAnnotation
,
Maslosoft\Mangan\Mangan
,
Maslosoft\Mangan\Meta\DocumentTypeMeta
,
Maslosoft\Mangan\Options\EntityOptions
Author: Piotr Maselkowski
Located at Traits/Defaults/MongoClientOptions.php
Properties summary
public
string
|
$authMechanism
Available mechanisms are: authMechanism Description Availability MONGODB-CR Authenticate using Challenge Response mechanism. This is the default value. All MongoDB versions X509 Authenticates using X509 certificates MongoDB 2.6. Only available when OpenSSL is enabled PLAIN Authenticates using unencrypted plain username+password. Must be used over SSL connections. Generally used by MongoDB to login via 3rd party LDAP server MongoDB Enterprise 2.4. The Driver must be compiled against CyrusSASL2 GSSAPI Authenticates via kerberos systems MongoDB Enterprise 2.4. The Driver must be compiled against CyrusSASL2 |
#
Maslosoft\Mangan\Traits\Defaults\AuthMechanism::MongoDBCR
|
public
string
|
$authSource
Should be set to the database name where the user is defined it. |
|
public
boolean
|
$connect
If the constructor should connect before returning. Default is FALSE. When set to FALSE the driver will automatically connect to the server whenever it is necessary to do a query. Alternatively, you can run MongoClient::connect() manually. |
#
false
|
public
integer
|
$connectTimeoutMS
How long a connection can take to be opened before timing out in milliseconds. Defaults to 60000 (60 seconds). |
#
60000
|
public
string
|
$db
The database to authenticate against can be specified here, instead of including it in the host list. This overrides a database given in the host list. |
|
public
boolean
|
$fsync
Boolean, defaults to FALSE. If journaling is enabled, it works exactly like "j". If journaling is not enabled, the write operation blocks until it is synced to database files on disk. If TRUE, an acknowledged insert is implied and this option will override setting "w" to 0. |
#
false
|
public
boolean
|
$journal
Boolean, defaults to FALSE. If journaling is enabled, it works exactly like "j". If journaling is not enabled, the write operation blocks until it is synced to database files on disk. If TRUE, an acknowledged insert is implied and this option will override setting "w" to 0. |
#
false
|
public
string
|
$gssapiServiceName
Sets the » Kerberos service principal. Only applicable when authMechanism=GSSAPI. Defaults to "mongodb". |
|
public
string
|
$password
The password can be specified here, instead of including it in the host list. This is especially useful if a password has a "@" in it. This overrides a password set in the host list. |
|
public
integer
|
$readPreference
Specifies the read preference type. Read preferences provide you with control from which secondaries data can be read from. |
#
Maslosoft\Mangan\Traits\Defaults\MongoClient::RP_PRIMARY
|
public
integer|string[]
|
$readPreferenceTags
Specifies the read preference tags as an array of strings. Tags can be used in combination with the readPreference option to further control which secondaries data might be read from. |
|
public
string
|
$replicaSet
The name of the replica set to connect to. If this is given, the primary will be automatically be determined. This means that the driver may end up connecting to a server that was not even listed. See the replica set example below for details. |
|
public
integer
|
$secondaryAcceptableLatencyMS
When reading from a secondary (using ReadPreferences), do not read from secondaries known to be more then secondaryAcceptableLatencyMS away from us. Defaults to 15 |
#
15
|
public
integer
|
$socketTimeoutMS
How long a socket operation (read or write) can take before timing out in milliseconds. Defaults to 30000 (30 seconds). |
#
30000
|
public
string
|
$ssl
A boolean to specify whether you want to enable SSL for the connections to MongoDB. Extra options such as certificates can be set with SSL context options. |
#
'false'
|
public
string
|
$username
The username can be specified here, instead of including it in the host list. This is especially useful if a username has a ":" in it. This overrides a username set in the host list. |
#
''
|
public
integer|string
|
$w
The w option specifies the Write Concern for the driver, which determines how long the driver blocks when writing. The default value is 1. |
#
1
|
public
integer
|
$wTimeoutMS
This option specifies the time limit, in milliseconds, for write concern acknowledgement. It is only applicable when "w" is greater than 1, as the timeout pertains to replication. If the write concern is not satisfied within the time limit, a MongoCursorException will be thrown. A value of 0 may be specified to block indefinitely. The default value for MongoClient is 10000 (ten seconds). |
#
10000
|