Skip to content

Commit 9a53ec6

Browse files
committed
Refactor option/param includes and document MongoDB 3.4 features
1 parent 12f583d commit 9a53ec6

File tree

101 files changed

+820
-1065
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+820
-1065
lines changed

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ type: array
44
description: |
55
Default :php:`type map
66
<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:
7+
to apply to cursors, which determines how BSON documents are converted to PHP
8+
values. The |php-library| uses the following type map by default:
109
1110
.. code-block:: php
1211
@@ -16,7 +15,6 @@ description: |
1615
'root' => 'MongoDB\Model\BSONDocument',
1716
]
1817
interface: phpmethod
19-
operation: MongoDB\\Client::__construct
18+
operation: ~
2019
optional: true
21-
position: 1
2220
...

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

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,10 @@ description: |
66
connect. Refer to the :manual:`MongoDB connection string reference
77
</reference/connection-string>` for formatting.
88
9-
Defaults to ``mongodb://127.0.0.1:27017`` if unspecified.
9+
Defaults to ``"mongodb://127.0.0.1:27017"`` if unspecified.
1010
interface: phpmethod
11-
operation: MongoDB\\Client::__construct
11+
operation: ~
1212
optional: true
13-
position: 1
1413
---
1514
arg_name: param
1615
name: $uriOptions
@@ -19,15 +18,14 @@ description: |
1918
Specifies additional URI options, such as authentication credentials or query
2019
string parameters. The options specified in ``$uriOptions`` take precedence
2120
over any analogous options present in the ``$uri`` string.
22-
post: |
21+
2322
Refer to the :php:`MongoDB\\Driver\\Manager::__construct()
2423
<mongodb-driver-manager.construct>` extension reference and :manual:`MongoDB
25-
connection string </reference/connection-string>` documentation for valid
24+
connection string </reference/connection-string>` documentation for accepted
2625
options.
2726
interface: phpmethod
28-
operation: MongoDB\\Client::__construct
27+
operation: ~
2928
optional: true
30-
position: 2
3129
---
3230
arg_name: param
3331
name: $driverOptions
@@ -39,7 +37,6 @@ description: |
3937
<manual/en/mongodb.persistence.deserialization.php#mongodb.persistence.typemaps>`
4038
to apply to the cursors it creates.
4139
interface: phpmethod
42-
operation: MongoDB\\Client::__construct
40+
operation: ~
4341
optional: true
44-
position: 3
4542
...
Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,19 @@
11
source:
22
file: apiargs-common-option.yaml
33
ref: typeMap
4-
operation: MongoDB\\Client::dropDatabase
4+
post: |
5+
This will be used for the returned command result document.
6+
---
7+
arg_name: option
8+
name: writeConcern
9+
type: :php:`MongoDB\\Driver\\WriteConcern <class.mongodb-driver-writeconcern>`
510
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.
11+
:manual:`Write concern </reference/write-concern>` to use for the operation.
12+
Defaults to the client's write concern.
13+
14+
This is not supported for server versions prior to 3.4 and will result in an
15+
exception at execution time if used.
16+
interface: phpmethod
17+
operation: ~
18+
optional: true
819
...
Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
source:
22
file: apiargs-common-param.yaml
33
ref: $databaseName
4-
operation: MongoDB\\Client::dropDatabase
5-
position: 1
64
replacement:
75
action: " to drop"
86
---
97
source:
108
file: apiargs-common-param.yaml
119
ref: $options
12-
operation: MongoDB\\Client::dropDatabase
13-
position: 2
1410
...
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
source:
22
file: apiargs-common-param.yaml
33
ref: $databaseName
4-
operation: MongoDB\\Client::__get
5-
position: 1
64
replacement:
75
action: " to select"
86
...
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
source:
22
file: apiargs-common-option.yaml
33
ref: maxTimeMS
4-
operation: MongoDB\\Client::listDatabases
54
...
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
source:
22
file: apiargs-common-param.yaml
33
ref: $options
4-
operation: MongoDB\\Client::listDatabases
5-
position: 1
64
...
Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,16 @@
11
source:
22
file: apiargs-common-param.yaml
33
ref: $databaseName
4-
operation: MongoDB\\Client::selectCollection
5-
position: 1
64
replacement:
75
action: " containing the collection to select"
86
---
97
source:
108
file: apiargs-common-param.yaml
119
ref: $collectionName
12-
operation: MongoDB\\Client::selectCollection
13-
position: 2
1410
replacement:
1511
action: " to select"
1612
---
1713
source:
1814
file: apiargs-common-param.yaml
1915
ref: $options
20-
operation: MongoDB\\Client::selectCollection
21-
position: 3
2216
...
Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
source:
22
file: apiargs-common-param.yaml
33
ref: $databaseName
4-
operation: MongoDB\\Client::selectDatabase
5-
position: 1
64
replacement:
75
action: " to select"
86
---
97
source:
108
file: apiargs-common-param.yaml
119
ref: $options
12-
operation: MongoDB\\Client::selectDatabase
13-
position: 2
1410
...
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
arg_name: option
2+
name: bypassDocumentValidation
3+
type: boolean
4+
description: |
5+
If ``true``, allows the write operation to circumvent document level
6+
validation. Defaults to ``false``.
7+
interface: phpmethod
8+
operation: ~
9+
optional: true
10+
---
11+
arg_name: option
12+
name: collation
13+
type: array|object
14+
description: |
15+
:manual:`Collation </reference/collation>` allows users to specify
16+
language-specific rules for string comparison, such as rules for lettercase
17+
and accent marks. When specifying collation, the ``locale`` field is
18+
mandatory; all other collation fields are optional. For descriptions of the
19+
fields, see :manual:`Collation Document
20+
<reference/collation/#collation-document>`.
21+
22+
If the collation is unspecified but the collection has a default collation,
23+
the operation uses the collation specified for the collection. If no
24+
collation is specified for the collection or for the operation, MongoDB uses
25+
the simple binary comparison used in prior versions for string comparisons.
26+
27+
This option is available in MongoDB 3.4+ and will result in an exception at
28+
execution time if specified for an older server version.
29+
interface: phpmethod
30+
operation: ~
31+
optional: true
32+
---
33+
arg_name: option
34+
name: readConcern
35+
type: :php:`MongoDB\\Driver\\ReadConcern <class.mongodb-driver-readconcern>`
36+
description: |
37+
:manual:`Read concern </reference/read-concern>` to use for the operation.
38+
Defaults to the collection's read concern.
39+
interface: phpmethod
40+
operation: ~
41+
optional: true
42+
---
43+
arg_name: option
44+
name: readPreference
45+
type: :php:`MongoDB\\Driver\\ReadPreference <class.mongodb-driver-readpreference>`
46+
description: |
47+
:manual:`Read preference </reference/read-preference>` to use for the
48+
operation. Defaults to the collection's read preference.
49+
interface: phpmethod
50+
operation: ~
51+
optional: true
52+
---
53+
source:
54+
file: apiargs-common-option.yaml
55+
ref: typeMap
56+
replacement:
57+
parent: "collection"
58+
---
59+
arg_name: option
60+
name: writeConcern
61+
type: :php:`MongoDB\\Driver\\WriteConcern <class.mongodb-driver-writeconcern>`
62+
description: |
63+
:manual:`Write concern </reference/write-concern>` to use for the operation.
64+
Defaults to the collection's write concern.
65+
interface: phpmethod
66+
operation: ~
67+
optional: true
68+
---
69+
arg_name: option
70+
name: upsert
71+
type: boolean
72+
description: |
73+
If set to ``true``, creates a new document when no document matches the query
74+
criteria. The default value is ``false``, which does not insert a new
75+
document when no match is found.
76+
interface: phpmethod
77+
operation: ~
78+
optional: true
79+
...
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
arg_name: param
2+
name: $filter
3+
type: array|object
4+
description: |
5+
The filter criteria that specifies the documents{{action}}.
6+
interface: phpmethod
7+
operation: ~
8+
optional: false
9+
replacement:
10+
action: ""
11+
---
12+
arg_name: param
13+
name: $replacement
14+
type: array|object
15+
description: |
16+
The replacement document.
17+
interface: phpmethod
18+
operation: ~
19+
optional: false
20+
---
21+
arg_name: param
22+
name: $update
23+
type: array|object
24+
description: |
25+
Specifies the field and value combinations to update and any relevant update
26+
operators. ``$update`` uses MongoDB's :method:`update operators
27+
</reference/operator/update>`.
28+
interface: phpmethod
29+
operation: ~
30+
optional: false
31+
...

docs/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml

Lines changed: 33 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -3,68 +3,59 @@ name: allowDiskUse
33
type: boolean
44
description: |
55
Enables writing to temporary files. When set to ``true``, aggregation stages
6-
can write data to the ``_tmp`` sub-directory in the dbPath directory.
7-
The default is ``false``.
6+
can write data to the ``_tmp`` sub-directory in the ``dbPath`` directory. The
7+
default is ``false``.
88
interface: phpmethod
9-
operation: MongoDB\\Collection::aggregate
9+
operation: ~
1010
optional: true
11-
position: 1
1211
---
1312
arg_name: option
1413
name: batchSize
1514
type: integer
1615
description: |
17-
The number of documents to return per batch
16+
Specifies the initial batch size for the cursor. A batchSize of ``0`` means an
17+
empty first batch and is useful for quickly returning a cursor or failure
18+
message without doing significant server-side work.
19+
20+
.. note::
21+
22+
This is not supported for inline aggregation results (i.e. ``useCursor``
23+
option is ``false`` or the server version is < 2.6).
1824
interface: phpmethod
19-
operation: MongoDB\\Collection::aggregate
25+
operation: ~
2026
optional: true
21-
position: 2
2227
---
2328
source:
24-
file: apiargs-common-option.yaml
29+
file: apiargs-MongoDBCollection-common-option.yaml
2530
ref: bypassDocumentValidation
26-
operation: MongoDB\\Collection::aggregate
27-
position: 3
31+
post: |
32+
This only applies when using the :pipeline:`$out` stage.
33+
34+
Document validation requires MongoDB 3.2 or later: if you are using an earlier
35+
version of MongoDB, this option will be ignored.
2836
---
2937
source:
3038
file: apiargs-common-option.yaml
3139
ref: maxTimeMS
32-
operation: MongoDB\\Collection::aggregate
33-
position: 4
3440
---
3541
source:
36-
file: apiargs-common-option.yaml
42+
file: apiargs-MongoDBCollection-common-option.yaml
3743
ref: readConcern
38-
operation: MongoDB\\Collection::aggregate
39-
position: 5
40-
replacement:
41-
resource: "aggregation"
42-
parent: "collection"
4344
---
4445
source:
45-
file: apiargs-common-option.yaml
46+
file: apiargs-MongoDBCollection-common-option.yaml
4647
ref: readPreference
47-
operation: MongoDB\\Collection::aggregate
48-
position: 6
49-
replacement:
50-
resource: "aggregation"
51-
parent: "collection"
5248
---
5349
source:
54-
file: apiargs-common-option.yaml
50+
file: apiargs-MongoDBCollection-common-option.yaml
5551
ref: typeMap
56-
operation: MongoDB\\Collection::aggregate
57-
position: 7
58-
description: |
59-
Type map for BSON deserialization. This will be applied to the returned
60-
cursor. Defaults to the collections's type map.
61-
52+
post: |
6253
.. note::
6354
6455
This is not supported for inline aggregation results (i.e. ``useCursor``
6556
option is ``false`` or the server version is < 2.6).
6657
---
67-
arg_name: param
58+
arg_name: option
6859
name: useCursor
6960
type: boolean
7061
description: |
@@ -77,7 +68,15 @@ description: |
7768
``useCursor`` is ignored for MongoDB versions prior to 2.6 as aggregation
7869
cursors are not available.
7970
interface: phpmethod
80-
operation: MongoDB\\Collection::aggregate
71+
operation: ~
8172
optional: true
82-
position: 8
73+
---
74+
source:
75+
file: apiargs-MongoDBCollection-common-option.yaml
76+
ref: writeConcern
77+
post: |
78+
This only applies when the ``$out`` stage is specified.
79+
80+
This is not supported for server versions prior to 3.4 and will result in an
81+
exception at execution time if used.
8382
...

docs/includes/apiargs-MongoDBCollection-method-aggregate-param.yaml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,10 @@ description: |
55
Specifies an :manual:`aggregation pipeline </core/aggregation-pipeline>`
66
operation.
77
interface: phpmethod
8-
operation: MongoDB\\Collection::aggregate
9-
position: 1
8+
operation: ~
9+
optional: false
1010
---
1111
source:
1212
file: apiargs-common-param.yaml
1313
ref: $options
14-
operation: MongoDB\\Collection::aggregate
15-
position: 2
1614
...

0 commit comments

Comments
 (0)