@@ -86,11 +86,31 @@ Server manual.
86
86
Create a MongoDB\Client
87
87
-----------------------
88
88
89
- To create a connection to MongoDB, pass your connection string when constructing
90
- an instance of the ``MongoDB\Client`` class.
89
+ To create a connection to MongoDB, construct a ``MongoDB\Client`` object.
90
+ Pass the following parameters to the ``MongoDB\Client`` constructor:
91
91
92
- In the following example, the library uses a sample connection URI to connect to a MongoDB
93
- deployment on port ``27017`` of ``localhost``:
92
+ - ``$uri``: Sets the connection string.
93
+
94
+ - ``$uriOptions``: *(Optional)* Sets URI options to configure how the client
95
+ connects to MongoDB, including authentication credentials and
96
+ and server selection settings. If you set the same options in this
97
+ parameter and in your connection string, the ``$uriOptions`` values
98
+ take precedence. To view a full list of supported options, see
99
+ the :ref:`php-connection-options` guide.
100
+
101
+ - ``$driverOptions``: *(Optional)* Sets options to configure the behavior of the
102
+ underlying {+extension-short+}, including data encryption settings and certificate
103
+ validation options for TLS connections. To view a full list of supported options,
104
+ see :phpmethod:`MongoDB\Client::__construct()` in the {+library-short+} API
105
+ documentation.
106
+
107
+ This example constructs a client and passes the following parameters:
108
+
109
+ - Connection URI, which connects to a MongoDB deployment on port ``27017``
110
+ of ``localhost``
111
+
112
+ - URI options parameter, which instructs the {+library-short+} to wait
113
+ ``10000`` milliseconds for server selection before generating an error
94
114
95
115
.. literalinclude:: /includes/connect/client.php
96
116
:language: php
0 commit comments