@@ -31,7 +31,7 @@ passing them to the ``MongoDB\Client`` constructor.
31
31
32
32
.. TODO:
33
33
-code samples
34
- - fix table widths
34
+ - move information to right colummn of tables
35
35
36
36
.. _php-connection-uri:
37
37
@@ -90,18 +90,17 @@ Replica Set Options
90
90
:stub-columns: 1
91
91
92
92
* - Connection Option
93
- - Data Type
94
- - Syntax
93
+ - Description
95
94
96
95
* - :manual:`directConnection </reference/connection-string/#mongodb-urioption-urioption.directConnection>`
97
- - {+bool-data-type+}
98
- - | **MongoDB\\Client**: ``$uriOptions = [ 'directConnection' => true ];``
99
- | **Connection URI**: ``directConnection=true``
96
+ - | **Data Type**: {+bool-data-type+}
97
+ | **MongoDB\\Client Example **: ``$uriOptions = [ 'directConnection' => true ];``
98
+ | **Connection URI Example **: ``directConnection=true``
100
99
101
100
* - :manual:`replicaSet </reference/connection-string/#mongodb-urioption-urioption.replicaSet>`
102
101
- {+string-data-type+}
103
- - | **MongoDB\\Client**: ``$uriOptions = [ 'replicaSet' => 'replicaSetName' ];``
104
- | **Connection URI**: ``replicaSet=replicaSetName``
102
+ - | **MongoDB\\Client Example **: ``$uriOptions = [ 'replicaSet' => 'replicaSetName' ];``
103
+ | **Connection URI Example **: ``replicaSet=replicaSetName``
105
104
106
105
Connection Options
107
106
~~~~~~~~~~~~~~~~~~
@@ -124,13 +123,13 @@ Timeout Options
124
123
125
124
* - :manual:`connectTimeoutMS </reference/connection-string/#mongodb-urioption-urioption.connecttimeoutms>`
126
125
- {+int-data-type+}
127
- - | **MongoDB\\Client**: ``$uriOptions = [ 'connectTimeoutMS' => 20000 ];``
128
- | **Connection URI**: ``connectTimeoutMS=20000``
126
+ - | **MongoDB\\Client Example **: ``$uriOptions = [ 'connectTimeoutMS' => 20000 ];``
127
+ | **Connection URI Example **: ``connectTimeoutMS=20000``
129
128
130
129
* - :manual:`socketTimeoutMS </reference/connection-string/#mongodb-urioption-urioption.sockettimeoutms>`
131
130
- {+int-data-type+}
132
- - | **MongoDB\\Client**: ``$uriOptions = [ 'socketTimeoutMS' => 400000 ];``
133
- | **Connection URI**: ``socketTimeoutMS=400000``
131
+ - | **MongoDB\\Client Example **: ``$uriOptions = [ 'socketTimeoutMS' => 400000 ];``
132
+ | **Connection URI Example **: ``socketTimeoutMS=400000``
134
133
135
134
.. _php-compression-options:
136
135
@@ -147,13 +146,13 @@ Compression Options
147
146
148
147
* - :manual:`compressors </reference/connection-string/#mongodb-urioption-urioption.compressors>`
149
148
- {+string-data-type+}
150
- - | **MongoDB\\Client**: ``$uriOptions = [ 'compressors' => 'snappy,zstd,zlib' ];``
151
- | **Connection URI**: ``compressors=snappy,zstd,zlib``
149
+ - | **MongoDB\\Client Example **: ``$uriOptions = [ 'compressors' => 'snappy,zstd,zlib' ];``
150
+ | **Connection URI Example **: ``compressors=snappy,zstd,zlib``
152
151
153
152
* - :manual:`zlibCompressionLevel </reference/connection-string/#mongodb-urioption-urioption.zlibcompressionlevel>`
154
153
- {+int-data-type+}
155
- - | **MongoDB\\Client**: ``$uriOptions = [ 'zlibCompressionLevel' => 3 ];``
156
- | **Connection URI**: ``zlibCompressionLevel=3``
154
+ - | **MongoDB\\Client Example **: ``$uriOptions = [ 'zlibCompressionLevel' => 3 ];``
155
+ | **Connection URI Example **: ``zlibCompressionLevel=3``
157
156
158
157
Connection Pool Options
159
158
~~~~~~~~~~~~~~~~~~~~~~~
@@ -168,13 +167,13 @@ Connection Pool Options
168
167
169
168
* - :manual:`maxPoolSize </reference/connection-string/#mongodb-urioption-urioption.maxpoolsize>`
170
169
- {+int-data-type+}
171
- - | **MongoDB\\Client**: N/A
172
- | **Connection URI**: ``maxPoolSize=75``
170
+ - | **MongoDB\\Client Example **: N/A
171
+ | **Connection URI Example **: ``maxPoolSize=75``
173
172
174
173
* - :manual:`waitQueueTimeoutMS </reference/connection-string/#mongodb-urioption-urioption.waitqueuetimeoutms>`
175
174
- {+int-data-type+}
176
- - | **MongoDB\\Client**: N/A
177
- | **Connection URI**: ``waitQueueTimeoutMS=10000``
175
+ - | **MongoDB\\Client Example **: N/A
176
+ | **Connection URI Example **: ``waitQueueTimeoutMS=10000``
178
177
179
178
Write Concern Options
180
179
~~~~~~~~~~~~~~~~~~~~~
@@ -189,18 +188,18 @@ Write Concern Options
189
188
190
189
* - :manual:`w </reference/connection-string/#mongodb-urioption-urioption.w>`
191
190
- {+string-data-type+}
192
- - | **MongoDB\\Client**: ``$uriOptions = [ 'w' => 'majority' ];``
193
- | **Connection URI**: ``w=majority``
191
+ - | **MongoDB\\Client Example **: ``$uriOptions = [ 'w' => 'majority' ];``
192
+ | **Connection URI Example **: ``w=majority``
194
193
195
194
* - :manual:`wTimeoutMS </reference/connection-string/#mongodb-urioption-urioption.wtimeoutms>`
196
195
- {+int-data-type+}
197
- - | **MongoDB\\Client**: ``$uriOptions = [ 'wTimeoutMS' => 10000 ];``
198
- | **Connection URI**: ``wTimeoutMS=10000``
196
+ - | **MongoDB\\Client Example **: ``$uriOptions = [ 'wTimeoutMS' => 10000 ];``
197
+ | **Connection URI Example **: ``wTimeoutMS=10000``
199
198
200
199
* - :manual:`journal </reference/connection-string/#mongodb-urioption-urioption.journal>`
201
200
- {+bool-data-type+}
202
- - | **MongoDB\\Client**: ``$uriOptions = [ 'journal' => true ];``
203
- | **Connection URI**: ``journal=true``
201
+ - | **MongoDB\\Client Example **: ``$uriOptions = [ 'journal' => true ];``
202
+ | **Connection URI Example **: ``journal=true``
204
203
205
204
Read Concern Options
206
205
~~~~~~~~~~~~~~~~~~~~
@@ -215,8 +214,8 @@ Read Concern Options
215
214
216
215
* - :manual:`readConcernLevel </reference/connection-string/#mongodb-urioption-urioption.readconcernlevel>`
217
216
- {+string-data-type+}
218
- - | **MongoDB\\Client**: ``$uriOptions = [ 'readConcernLevel' => 'majority' ];``
219
- | **Connection URI**: ``readConcernLevel=majority``
217
+ - | **MongoDB\\Client Example **: ``$uriOptions = [ 'readConcernLevel' => 'majority' ];``
218
+ | **Connection URI Example **: ``readConcernLevel=majority``
220
219
221
220
Read Preference Options
222
221
~~~~~~~~~~~~~~~~~~~~~~~
@@ -232,22 +231,22 @@ Read Preference Options
232
231
233
232
* - :manual:`readPreference </reference/connection-string/#mongodb-urioption-urioption.readpreference>`
234
233
- ``int`` or ``string``
235
- - **MongoDB\\Client**: ``$uriOptions = [ 'readPreference' => 'secondaryPreferred' ];``
234
+ - **MongoDB\\Client Example **: ``$uriOptions = [ 'readPreference' => 'secondaryPreferred' ];``
236
235
237
- **Connection URI**: ``readPreference=secondaryPreferred``
236
+ **Connection URI Example **: ``readPreference=secondaryPreferred``
238
237
239
238
For a complete list of the available values for this option, see the
240
239
`MongoDB\\Driver\\ReadPreference <https://www.php.net/manual/en/class.mongodb-driver-readpreference.php>`__
241
240
API documentation.
242
241
243
242
* - :manual:`maxStalenessSeconds </reference/connection-string/#mongodb-urioption-urioption.maxstalenessseconds>`
244
243
- {+int-data-type+}
245
- - | **MongoDB\\Client**: ``$uriOptions = [ 'maxStalenessSeconds' => 30 ];``
246
- | **Connection URI**: ``maxStalenessSeconds=30``
244
+ - | **MongoDB\\Client Example **: ``$uriOptions = [ 'maxStalenessSeconds' => 30 ];``
245
+ | **Connection URI Example **: ``maxStalenessSeconds=30``
247
246
248
247
* - :manual:`readPreferenceTags </reference/connection-string/#mongodb-urioption-urioption.readpreferencetags>`
249
248
- ``array``
250
- - **MongoDB\\Client**:
249
+ - **MongoDB\\Client Example **:
251
250
252
251
.. code-block::
253
252
:copyable: false
@@ -259,7 +258,7 @@ Read Preference Options
259
258
]
260
259
];
261
260
262
- **Connection URI**: ``readPreferenceTags=region:east,region:west``
261
+ **Connection URI Example **: ``readPreferenceTags=region:east,region:west``
263
262
264
263
Authentication Options
265
264
~~~~~~~~~~~~~~~~~~~~~~
@@ -275,18 +274,18 @@ Authentication Options
275
274
276
275
* - :manual:`authMechanism </reference/connection-string/#mongodb-urioption-urioption.authmechanism>`
277
276
- {+string-data-type+}
278
- - | **MongoDB\\Client**: ``$uriOptions = [ 'authMechanism' => 'MONGODB-X509' ];``
279
- | **Connection URI**: ``authMechanism=MONGODB-X509``
277
+ - | **MongoDB\\Client Example **: ``$uriOptions = [ 'authMechanism' => 'MONGODB-X509' ];``
278
+ | **Connection URI Example **: ``authMechanism=MONGODB-X509``
280
279
281
280
* - :manual:`authMechanismProperties </reference/connection-string/#mongodb-urioption-urioption.authmechanismproperties>`
282
281
- {+string-data-type+}
283
- - | **MongoDB\\Client**: ``$uriOptions = [ 'authMechanism' => 'MONGODB-AWS', 'authMechanismProperties' => 'AWS_SESSION_TOKEN:12345' ];``
284
- | **Connection URI**: ``authMechanism=MONGODB-AWS&authMechanismProperties=AWS_SESSION_TOKEN:12345``
282
+ - | **MongoDB\\Client Example **: ``$uriOptions = [ 'authMechanism' => 'MONGODB-AWS', 'authMechanismProperties' => 'AWS_SESSION_TOKEN:12345' ];``
283
+ | **Connection URI Example **: ``authMechanism=MONGODB-AWS&authMechanismProperties=AWS_SESSION_TOKEN:12345``
285
284
286
285
* - :manual:`authSource </reference/connection-string/#mongodb-urioption-urioption.authsource>`
287
286
- {+string-data-type+}
288
- - | **MongoDB\\Client**: ``$uriOptions = [ 'authSource' => 'admin' ];``
289
- | **Connection URI**: ``authSource=admin``
287
+ - | **MongoDB\\Client Example **: ``$uriOptions = [ 'authSource' => 'admin' ];``
288
+ | **Connection URI Example **: ``authSource=admin``
290
289
291
290
Server Selection and Discovery Options
292
291
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -302,28 +301,28 @@ Server Selection and Discovery Options
302
301
303
302
* - :manual:`localThresholdMS </reference/connection-string/#mongodb-urioption-urioption.localthresholdms>`
304
303
- {+int-data-type+}
305
- - | **MongoDB\\Client**: ``$uriOptions = [ 'localThresholdMS' => 20 ];``
306
- | **Connection URI**: ``localThresholdMS=20``
304
+ - | **MongoDB\\Client Example **: ``$uriOptions = [ 'localThresholdMS' => 20 ];``
305
+ | **Connection URI Example **: ``localThresholdMS=20``
307
306
308
307
* - :manual:`serverSelectionTimeoutMS </reference/connection-string/#mongodb-urioption-urioption.serverselectiontimeoutms>`
309
308
- {+int-data-type+}
310
- - | **MongoDB\\Client**: ``$uriOptions = [ 'serverSelectionTimeoutMS' => 40000 ];``
311
- | **Connection URI**: ``serverSelectionTimeoutMS=40000``
309
+ - | **MongoDB\\Client Example **: ``$uriOptions = [ 'serverSelectionTimeoutMS' => 40000 ];``
310
+ | **Connection URI Example **: ``serverSelectionTimeoutMS=40000``
312
311
313
312
* - :manual:`serverSelectionTryOnce </reference/connection-string/#mongodb-urioption-urioption.serverselectiontryonce>`
314
313
- {+bool-data-type+}
315
- - | **MongoDB\\Client**: ``$uriOptions = [ 'serverSelectionTryOnce' => false ];``
316
- | **Connection URI**: ``serverSelectionTryOnce=false``
314
+ - | **MongoDB\\Client Example **: ``$uriOptions = [ 'serverSelectionTryOnce' => false ];``
315
+ | **Connection URI Example **: ``serverSelectionTryOnce=false``
317
316
318
317
* - :manual:`heartbeatFrequencyMS </reference/connection-string/#mongodb-urioption-urioption.heartbeatfrequencyms>`
319
318
- {+int-data-type+}
320
- - | **MongoDB\\Client**: ``$uriOptions = [ 'heartbeatFrequencyMS' => 50000 ];``
321
- | **Connection URI**: ``heartbeatFrequencyMS=50000``
319
+ - | **MongoDB\\Client Example **: ``$uriOptions = [ 'heartbeatFrequencyMS' => 50000 ];``
320
+ | **Connection URI Example **: ``heartbeatFrequencyMS=50000``
322
321
323
322
* - :manual:`socketCheckIntervalMS </reference/connection-string/#mongodb-urioption-urioption.socketcheckintervalms>`
324
323
- {+int-data-type+}
325
- - | **MongoDB\\Client**: ``$uriOptions = [ 'socketCheckIntervalMS' => 4000 ];``
326
- | **Connection URI**: ``socketCheckIntervalMS=4000``
324
+ - | **MongoDB\\Client Example **: ``$uriOptions = [ 'socketCheckIntervalMS' => 4000 ];``
325
+ | **Connection URI Example **: ``socketCheckIntervalMS=4000``
327
326
328
327
Miscellaneous Configuration
329
328
~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -338,28 +337,28 @@ Miscellaneous Configuration
338
337
339
338
* - :manual:`appName </reference/connection-string/#mongodb-urioption-urioption.appname>`
340
339
- {+string-data-type+}
341
- - | **MongoDB\\Client**: ``$uriOptions = [ 'appName' => 'myApp' ];``
342
- | **Connection URI**: ``appName=myApp``
340
+ - | **MongoDB\\Client Example **: ``$uriOptions = [ 'appName' => 'myApp' ];``
341
+ | **Connection URI Example **: ``appName=myApp``
343
342
344
343
* - :manual:`retryReads </reference/connection-string/#mongodb-urioption-urioption.retryreads>`
345
344
- {+bool-data-type+}
346
- - | **MongoDB\\Client**: ``$uriOptions = [ 'retryReads' => false ];``
347
- | **Connection URI**: ``retryReads=false``
345
+ - | **MongoDB\\Client Example **: ``$uriOptions = [ 'retryReads' => false ];``
346
+ | **Connection URI Example **: ``retryReads=false``
348
347
349
348
* - :manual:`retryWrites </reference/connection-string/#mongodb-urioption-urioption.retrywrites>`
350
349
- {+bool-data-type+}
351
- - | **MongoDB\\Client**: ``$uriOptions = [ 'retryWrites' => false ];``
352
- | **Connection URI**: ``retryWrites=false``
350
+ - | **MongoDB\\Client Example **: ``$uriOptions = [ 'retryWrites' => false ];``
351
+ | **Connection URI Example **: ``retryWrites=false``
353
352
354
353
* - :manual:`loadBalanced </reference/connection-string/#mongodb-urioption-urioption.loadbalanced>`
355
354
- {+bool-data-type+}
356
- - | **MongoDB\\Client**: ``$uriOptions = [ 'loadBalanced' => true ];``
357
- | **Connection URI**: ``loadBalanced=false``
355
+ - | **MongoDB\\Client Example **: ``$uriOptions = [ 'loadBalanced' => true ];``
356
+ | **Connection URI Example **: ``loadBalanced=false``
358
357
359
358
* - :manual:`srvMaxHosts </reference/connection-string/#mongodb-urioption-urioption.srvmaxhosts>`
360
359
- {+int-data-type+}
361
- - | **MongoDB\\Client**: ``$uriOptions = [ 'srvMaxHosts' => 5 ];``
362
- | **Connection URI**: ``srvMaxHosts=5``
360
+ - | **MongoDB\\Client Example **: ``$uriOptions = [ 'srvMaxHosts' => 5 ];``
361
+ | **Connection URI Example **: ``srvMaxHosts=5``
363
362
364
363
API Documentation
365
364
-----------------
0 commit comments