Skip to content

Commit dd323f7

Browse files
committed
feedback
1 parent 03f667a commit dd323f7

File tree

2 files changed

+12
-18
lines changed

2 files changed

+12
-18
lines changed

source/connect/stable-api.txt

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ The following code example shows how to specify {+stable-api+} version 1:
5656
:copyable: true
5757
:start-after: // start-specify-v1
5858
:end-before: // end-specify-v1
59-
:emphasize-lines: 5-7, 9
59+
:emphasize-lines: 3,5
6060

6161
.. note::
6262

@@ -70,7 +70,7 @@ The following code example shows how to specify {+stable-api+} version 1:
7070
Configure the {+stable-api+}
7171
------------------------
7272

73-
The following table describes the parameters of the ``MongoDB\Driver\ServerApi`` constructor.
73+
The ``MongoDB\Driver\ServerApi`` constructor also accepts the following optional parameters.
7474
You can use these parameters to customize the behavior of the {+stable-api+}.
7575

7676
.. list-table::
@@ -83,15 +83,17 @@ You can use these parameters to customize the behavior of the {+stable-api+}.
8383

8484
* - strict
8585
- | **Optional**. When ``true``, if you call a command that isn't part of
86-
the declared API version, the library raises an exception.
86+
the declared API version, the server raises an exception.
8787
|
88-
| Default: ``false``
88+
| Default: ``null``. If this parameter is null, the server applies its default
89+
value of ``false``.
8990

9091
* - deprecationErrors
9192
- | **Optional**. When ``true``, if you call a command that is deprecated in the
92-
declared API version, the library raises an exception.
93+
declared API version, the server raises an exception.
9394
|
94-
| Default: ``false``
95+
| Default: ``null``. If this parameter is null, the server applies its default
96+
value of ``false``.
9597

9698
The following code example shows how you can use these parameters when constructing a
9799
``MongoDB\Driver\ServerApi`` object:
@@ -101,15 +103,15 @@ The following code example shows how you can use these parameters when construct
101103
:copyable: true
102104
:start-after: // start-stable-api-options
103105
:end-before: // end-stable-api-options
104-
:emphasize-lines: 5-7, 9
106+
:emphasize-lines: 3,5
105107

106108
API Documentation
107109
-----------------
108110

109111
For more information about the ``MongoDB\Client`` class, see the following {+driver-short+}
110112
API documentation:
111113

112-
- :ref:`MongoDB\Client <php-api-mongodbclient>`
114+
- :phpclass:`MongoDB\Client`
113115

114116
For more information about the ``MongoDB\Driver\ServerApi`` class, see the following
115117
{+extension-short+} API documentation:
Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,15 @@
11
// start-specify-v1
2-
<?php
3-
42
$uri = "mongodb://<hostname>:<port>";
53

6-
$driverOptions = [
7-
'serverApi' => new MongoDB\Driver\ServerApi('1')
8-
];
4+
$driverOptions = ['serverApi' => new MongoDB\Driver\ServerApi('1')];
95

106
$client = new MongoDB\Client($uri, [], $driverOptions);
117
// end-specify-v1
128

139
// start-stable-api-options
14-
<?php
15-
1610
$uri = "mongodb://<hostname>:<port>";
1711

18-
$driverOptions = [
19-
'serverApi' => new MongoDB\Driver\ServerApi('1', true, true)
20-
];
12+
$driverOptions = ['serverApi' => new MongoDB\Driver\ServerApi('1', strict: true, deprecationErrors: true)];
2113

2214
$client = new MongoDB\Client($uri, [], $driverOptions);
2315
// end-stable-api-options

0 commit comments

Comments
 (0)