@@ -30,8 +30,8 @@ You can configure your connection by specifying options in the connection URI or
30
30
passing them to the ``MongoDB\Client`` constructor.
31
31
32
32
.. TODO:
33
- how uri object overrides uri
34
- - finish intro text
33
+ -code samples
34
+ - fix table widths
35
35
36
36
.. _php-connection-uri:
37
37
@@ -52,8 +52,8 @@ the connection URI contains the ``tls`` option with a value of ``true`` and the
52
52
53
53
.. _php-client-object:
54
54
55
- Using a MongoDB\Client Object
56
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
55
+ Using a MongoDB\\ Client Object
56
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
57
57
58
58
You can pass connection options to the ``MongoDB\Client`` constructor
59
59
instead of including them in your connection URI.
@@ -70,6 +70,11 @@ The following example shows how to use the the ``$uriOptions`` parameter of the
70
70
:end-before: // end-client-options
71
71
:emphasize-lines: 8-12, 15
72
72
73
+ .. note::
74
+
75
+ If you specify an option in both the ``MongoDB\Client`` object and in the connection
76
+ URI, the value in the ``MongoDB\Client`` object takes precedence.
77
+
73
78
Connection URI Options
74
79
----------------------
75
80
@@ -135,6 +140,7 @@ Compression Options
135
140
.. list-table::
136
141
:header-rows: 1
137
142
:stub-columns: 1
143
+ :widths: 20 10 70
138
144
139
145
* - Connection Option
140
146
- Data Type
@@ -148,6 +154,7 @@ Compression Options
148
154
* - :manual:`zlibCompressionLevel </reference/connection-string/#mongodb-urioption-urioption.zlibcompressionlevel>`
149
155
- {+int-data-type+}
150
156
- | **MongoDB\Client**: ``$uriOptions = [ 'compressors' => 'snappy,zstd,zlib', 'zlibCompressionLevel' => 3 ];``
157
+ |
151
158
| **Connection URI**: ``compressors=snappy,zstd,zlib&zlibCompressionLevel=3``
152
159
153
160
Connection Pool Options
@@ -163,11 +170,13 @@ Connection Pool Options
163
170
164
171
* - :manual:`maxPoolSize </reference/connection-string/#mongodb-urioption-urioption.maxpoolsize>`
165
172
- {+int-data-type+}
166
- - | **Connection URI**: ``maxPoolSize=75``
173
+ - | **MongoDB\Client**: N/A
174
+ | **Connection URI**: ``maxPoolSize=75``
167
175
168
176
* - :manual:`waitQueueTimeoutMS </reference/connection-string/#mongodb-urioption-urioption.waitqueuetimeoutms>`
169
177
- {+int-data-type+}
170
- - | **Connection URI**: ``waitQueueTimeoutMS=10000``
178
+ - | **MongoDB\Client**: N/A
179
+ | **Connection URI**: ``waitQueueTimeoutMS=10000``
171
180
172
181
Write Concern Options
173
182
~~~~~~~~~~~~~~~~~~~~~
@@ -217,13 +226,14 @@ Read Preference Options
217
226
.. list-table::
218
227
:header-rows: 1
219
228
:stub-columns: 1
229
+ :widths: 20 20 60
220
230
221
231
* - Connection Option
222
232
- Data Type
223
233
- Syntax
224
234
225
235
* - :manual:`readPreference </reference/connection-string/#mongodb-urioption-urioption.readpreference>`
226
- - `MongoDB\Driver\ReadPreference <https://www.php.net/manual/en/class.mongodb-driver-readpreference.php>`__
236
+ - `MongoDB\\ Driver\ \ReadPreference <https://www.php.net/manual/en/class.mongodb-driver-readpreference.php>`__
227
237
- | **MongoDB\Client**: ``$uriOptions = [ 'readPreference' => MongoDB\Driver\ReadPreference.RP_SECONDARY_PREFERRED ];``
228
238
| **Connection URI**: ``readPreference=secondaryPreferred``
229
239
@@ -237,13 +247,13 @@ Read Preference Options
237
247
- | **MongoDB\Client**: ``$uriOptions = [ 'readPreferenceTags' => [[ 'region' => 'east' ], [ 'region' => 'west']];``
238
248
| **Connection URI**: ``readPreferenceTags=region:east,region:west``
239
249
240
-
241
250
Authentication Options
242
251
~~~~~~~~~~~~~~~~~~~~~~
243
252
244
253
.. list-table::
245
254
:header-rows: 1
246
255
:stub-columns: 1
256
+ :widths: 20 10 70
247
257
248
258
* - Connection Option
249
259
- Data Type
@@ -343,4 +353,4 @@ For more information about the types used on this page, see the following API
343
353
documentation:
344
354
345
355
- :ref:`MongoDB\Client <php-mongodbclient>`
346
- - `MongoDB\Driver\ReadPreference <https://www.php.net/manual/en/class.mongodb-driver-readpreference.php>`__
356
+ - `MongoDB\\ Driver\ \ReadPreference <https://www.php.net/manual/en/class.mongodb-driver-readpreference.php>`__
0 commit comments