Skip to content

Commit fde84d8

Browse files
committed
feedback
1 parent a1b3322 commit fde84d8

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

source/connect/stable-api.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ In this guide, you can learn how to specify **{+stable-api+}** compatibility whe
2828
connecting to a MongoDB deployment.
2929

3030
The {+stable-api+} feature forces the server to run operations with behaviors compatible
31-
with the API version you specify. When you update either your driver or server,
31+
with the API version you specify. When you update either your library or server version,
3232
the API version changes, which can change the way these operations behave.
3333
Using the {+stable-api+} ensures consistent responses from the server and
3434
provides long-term API stability for your application.
@@ -44,7 +44,7 @@ Enable the {+stable-api+}
4444
To enable the {+stable-api+}, perform the following steps:
4545

4646
1. Construct a ``MongoDB\Driver\ServerApi`` object and pass the {+stable-api+}
47-
version you want to use. Currently, the driver supports only version 1.
47+
version you want to use. Currently, the library supports only version 1.
4848
#. Construct a ``MongoDB\Client`` object. For the ``driverOptions`` parameter, pass an
4949
array that contains the ``serverApi`` connection option. Set this option to the
5050
``MongoDB\Driver\ServerApi`` object you created in the previous step.
@@ -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
59+
:emphasize-lines: 5-7, 9
6060

6161
.. note::
6262

@@ -78,7 +78,7 @@ You can use these parameters to customize the behavior of the {+stable-api+}.
7878
:stub-columns: 1
7979
:widths: 25,75
8080

81-
* - Option Name
81+
* - Parameter
8282
- Description
8383

8484
* - strict
@@ -101,7 +101,7 @@ The following code example shows how you can use these parameters when construct
101101
:copyable: true
102102
:start-after: // start-stable-api-options
103103
:end-before: // end-stable-api-options
104-
:emphasize-lines: 5-7
104+
:emphasize-lines: 5-7, 9
105105

106106
API Documentation
107107
-----------------

source/includes/connect/stable-api.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,21 @@
33

44
$uri = "mongodb://<hostname>:<port>";
55

6-
$client = new MongoDB\Client($uri, [], [
6+
$driverOptions = [
77
'serverApi' => new MongoDB\Driver\ServerApi('1')
8-
]);
8+
];
99

10-
?>
10+
$client = new MongoDB\Client($uri, [], $driverOptions);
1111
// end-specify-v1
1212

1313
// start-stable-api-options
1414
<?php
1515

1616
$uri = "mongodb://<hostname>:<port>";
1717

18-
$client = new MongoDB\Client($uri, [], [
18+
$driverOptions = [
1919
'serverApi' => new MongoDB\Driver\ServerApi('1', true, true)
20-
]);
20+
];
2121

22-
?>
22+
$client = new MongoDB\Client($uri, [], $driverOptions);
2323
// end-stable-api-options

0 commit comments

Comments
 (0)