Skip to content

Commit 1892dc6

Browse files
committed
Update MongoDB\Client documentation
1 parent 470a904 commit 1892dc6

18 files changed

+227
-149
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
arg_name: option
2+
name: typeMap
3+
type: array
4+
description: |
5+
Default :php:`type map
6+
<manual/en/mongodb.persistence.deserialization.php#mongodb.persistence.typemaps>`
7+
to apply to cursors. The type map determines how BSON documents are converted
8+
to PHP values which determines. The |php-library| uses the following type map
9+
by default:
10+
11+
.. code-block:: php
12+
13+
[
14+
'array' => 'MongoDB\Model\BSONArray',
15+
'document' => 'MongoDB\Model\BSONDocument',
16+
'root' => 'MongoDB\Model\BSONDocument',
17+
]
18+
interface: phpmethod
19+
operation: MongoDB\\Client::__construct
20+
optional: true
21+
position: 1
22+
...

docs/includes/apiargs-MongoDBClient-method-construct-param.yaml

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ arg_name: param
22
name: $uri
33
type: string
44
description: |
5-
The URI of the standalone, replica set, or sharded cluster to which to connect. Refer
6-
to the :manual:`MongoDB connection string reference </reference/connection-string>`
7-
for formatting.
8-
9-
Defaults to ``mongodb://localhost:27017`` if unspecified.
5+
The URI of the standalone, replica set, or sharded cluster to which to
6+
connect. Refer to the :manual:`MongoDB connection string reference
7+
</reference/connection-string>` for formatting.
8+
9+
Defaults to ``mongodb://127.0.0.1:27017`` if unspecified.
1010
interface: phpmethod
1111
operation: MongoDB\\Client::__construct
1212
optional: true
@@ -16,15 +16,14 @@ arg_name: param
1616
name: $uriOptions
1717
type: array
1818
description: |
19-
Specifies additional URI options, such as authentication credentials
20-
or query string parameters. The options specified in ``$uriOptions``
21-
take precedence over any analogous options present in the
22-
``$uri`` string.
19+
Specifies additional URI options, such as authentication credentials or query
20+
string parameters. The options specified in ``$uriOptions`` take precedence
21+
over any analogous options present in the ``$uri`` string.
2322
post: |
2423
Refer to the :php:`MongoDB\\Driver\\Manager::__construct()
25-
<mongodb-driver-manager.construct>` extension reference and
26-
:manual:`MongoDB connection string </reference/connection-string>`
27-
documentation for valid options.
24+
<mongodb-driver-manager.construct>` extension reference and :manual:`MongoDB
25+
connection string </reference/connection-string>` documentation for valid
26+
options.
2827
interface: phpmethod
2928
operation: MongoDB\\Client::__construct
3029
optional: true
@@ -34,14 +33,13 @@ arg_name: param
3433
name: $driverOptions
3534
type: array
3635
description: |
37-
Specify driver-specific options. In addition to any
38-
options supported by the :php:`extension <mongodb-driver-manager>`,
39-
the |php-library| allows you to specify a default ``typeMap`` to
40-
apply to the cursors it creates. Refer to the driver's
41-
:php:`Persistence documentation <mongodb-persistence>` for more
42-
about type maps.
36+
Specify driver-specific options, such as SSL options. In addition to any
37+
options supported by the :php:`extension <mongodb-driver-manager>`, the
38+
|php-library| allows you to specify a default :php:`type map
39+
<manual/en/mongodb.persistence.deserialization.php#mongodb.persistence.typemaps>`
40+
to apply to the cursors it creates.
4341
interface: phpmethod
4442
operation: MongoDB\\Client::__construct
4543
optional: true
4644
position: 3
47-
...
45+
...
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
arg_name: option
2-
interface: phpmethod
3-
operation: MongoDB\\Client::dropDatabase
41
source:
52
file: apiargs-common-option.yaml
63
ref: typeMap
7-
position: 1
4+
operation: MongoDB\\Client::dropDatabase
5+
description: |
6+
Type map for BSON deserialization. This will be used for the returned command
7+
result document. Defaults to the clients's type map.
88
...
Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
source:
2-
ref: $databaseName
32
file: apiargs-common-param.yaml
4-
arg_name: param
5-
interface: phpmethod
3+
ref: $databaseName
64
operation: MongoDB\\Client::dropDatabase
5+
position: 1
76
---
87
source:
9-
ref: $options
108
file: apiargs-common-param.yaml
11-
arg_name: param
12-
interface: phpmethod
9+
ref: $options
1310
operation: MongoDB\\Client::dropDatabase
1411
position: 2
1512
...
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
source:
2-
ref: $databaseName
32
file: apiargs-common-param.yaml
4-
arg_name: param
5-
interface: phpmethod
3+
ref: $databaseName
64
operation: MongoDB\\Client::__get
5+
position: 1
76
...
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
source:
22
file: apiargs-common-option.yaml
33
ref: maxTimeMS
4-
position: 1
4+
operation: MongoDB\\Client::listDatabases
55
...
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
source:
2-
ref: $options
32
file: apiargs-common-param.yaml
4-
arg_name: param
5-
interface: phpmethod
3+
ref: $options
64
operation: MongoDB\\Client::listDatabases
75
position: 1
86
...
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
source:
2+
file: apiargs-common-option.yaml
3+
ref: readConcern
4+
replacement:
5+
resource: "collection"
6+
parent: "client"
7+
---
8+
source:
9+
file: apiargs-common-option.yaml
10+
ref: readPreference
11+
replacement:
12+
resource: "collection"
13+
parent: "client"
14+
---
15+
source:
16+
file: apiargs-common-option.yaml
17+
ref: typeMap
18+
replacement:
19+
parent: "client"
20+
---
21+
source:
22+
file: apiargs-common-option.yaml
23+
ref: writeConcern
24+
replacement:
25+
resource: "collection"
26+
parent: "client"
27+
...
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
source:
2+
file: apiargs-common-param.yaml
3+
ref: $databaseName
4+
operation: MongoDB\\Client::selectCollection
5+
position: 1
6+
---
7+
source:
8+
file: apiargs-common-param.yaml
9+
ref: $collectionName
10+
operation: MongoDB\\Client::selectCollection
11+
position: 2
12+
---
13+
source:
14+
file: apiargs-common-param.yaml
15+
ref: $options
16+
operation: MongoDB\\Client::selectCollection
17+
position: 3
18+
...
Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,27 @@
11
source:
2-
ref: readConcern
32
file: apiargs-common-option.yaml
4-
operation: MongoDB\\Client::selectDatabase
3+
ref: readConcern
54
replacement:
65
resource: "database"
6+
parent: "client"
77
---
88
source:
9-
ref: readPreference
109
file: apiargs-common-option.yaml
11-
operation: MongoDB\\Client::selectDatabase
10+
ref: readPreference
1211
replacement:
1312
resource: "database"
13+
parent: "client"
1414
---
1515
source:
16-
ref: typeMap
1716
file: apiargs-common-option.yaml
18-
operation: MongoDB\\Client::selectDatabase
17+
ref: typeMap
18+
replacement:
19+
parent: "client"
1920
---
2021
source:
21-
ref: writeConcern
2222
file: apiargs-common-option.yaml
23-
operation: MongoDB\\Client::selectDatabase
23+
ref: writeConcern
2424
replacement:
2525
resource: "database"
26-
...
26+
parent: "client"
27+
...

0 commit comments

Comments
 (0)