Skip to content

Commit 8adc084

Browse files
committed
PHPLIB-351: Documentation for watch() methods
1 parent b5f80fe commit 8adc084

19 files changed

+561
-93
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
arg_name: option
2+
name: readConcern
3+
type: :php:`MongoDB\\Driver\\ReadConcern <class.mongodb-driver-readconcern>`
4+
description: |
5+
:manual:`Read concern </reference/read-concern>` to use for the operation.
6+
Defaults to the client's read concern.
7+
8+
This is not supported for server versions prior to 3.2 and will result in an
9+
exception at execution time if used.
10+
interface: phpmethod
11+
operation: ~
12+
optional: true
13+
---
14+
arg_name: option
15+
name: readPreference
16+
type: :php:`MongoDB\\Driver\\ReadPreference <class.mongodb-driver-readpreference>`
17+
description: |
18+
:manual:`Read preference </reference/read-preference>` to use for the
19+
operation. Defaults to the client's read preference.
20+
interface: phpmethod
21+
operation: ~
22+
optional: true
23+
---
24+
source:
25+
file: apiargs-common-option.yaml
26+
ref: typeMap
27+
---
28+
arg_name: option
29+
name: writeConcern
30+
type: :php:`MongoDB\\Driver\\WriteConcern <class.mongodb-driver-writeconcern>`
31+
description: |
32+
:manual:`Write concern </reference/write-concern>` to use for the operation.
33+
Defaults to the client's write concern.
34+
interface: phpmethod
35+
operation: ~
36+
optional: true
37+
...

docs/includes/apiargs-MongoDBClient-method-dropDatabase-option.yaml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,10 @@ source:
1010
post: |
1111
This will be used for the returned command result document.
1212
---
13-
arg_name: option
14-
name: writeConcern
15-
type: :php:`MongoDB\\Driver\\WriteConcern <class.mongodb-driver-writeconcern>`
16-
description: |
17-
:manual:`Write concern </reference/write-concern>` to use for the operation.
18-
Defaults to the client's write concern.
19-
13+
source:
14+
file: apiargs-MongoDBClient-common-option.yaml
15+
ref: writeConcern
16+
post: |
2017
This is not supported for server versions prior to 3.4 and will result in an
2118
exception at execution time if used.
22-
interface: phpmethod
23-
operation: ~
24-
optional: true
2519
...
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
source:
3+
file: apiargs-method-watch-option.yaml
4+
ref: batchSize
5+
---
6+
source:
7+
file: apiargs-common-option.yaml
8+
ref: collation
9+
---
10+
source:
11+
file: apiargs-method-watch-option.yaml
12+
ref: fullDocument
13+
---
14+
source:
15+
file: apiargs-method-watch-option.yaml
16+
ref: maxAwaitTimeMS
17+
---
18+
source:
19+
file: apiargs-MongoDBClient-common-option.yaml
20+
ref: readConcern
21+
---
22+
source:
23+
file: apiargs-MongoDBClient-common-option.yaml
24+
ref: readPreference
25+
post: |
26+
This is used for both the initial change stream aggregation and for
27+
server selection during an automatic resume.
28+
---
29+
source:
30+
file: apiargs-method-watch-option.yaml
31+
ref: resumeAfter
32+
---
33+
source:
34+
file: apiargs-common-option.yaml
35+
ref: session
36+
---
37+
source:
38+
file: apiargs-method-watch-option.yaml
39+
ref: startAtOperationTime
40+
---
41+
source:
42+
file: apiargs-MongoDBClient-common-option.yaml
43+
ref: typeMap
44+
...
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
source:
2+
file: apiargs-method-watch-param.yaml
3+
ref: $pipeline
4+
---
5+
source:
6+
file: apiargs-method-watch-param.yaml
7+
ref: $options
8+
...

docs/includes/apiargs-MongoDBCollection-common-option.yaml

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -24,27 +24,14 @@ interface: phpmethod
2424
operation: ~
2525
optional: true
2626
---
27-
arg_name: option
28-
name: collation
29-
type: array|object
30-
description: |
31-
:manual:`Collation </reference/collation>` allows users to specify
32-
language-specific rules for string comparison, such as rules for lettercase
33-
and accent marks. When specifying collation, the ``locale`` field is
34-
mandatory; all other collation fields are optional. For descriptions of the
35-
fields, see :manual:`Collation Document
36-
</reference/collation/#collation-document>`.
37-
27+
source:
28+
file: apiargs-common-option.yaml
29+
ref: collation
30+
post: |
3831
If the collation is unspecified but the collection has a default collation,
3932
the operation uses the collation specified for the collection. If no
4033
collation is specified for the collection or for the operation, MongoDB uses
4134
the simple binary comparison used in prior versions for string comparisons.
42-
43-
This option is available in MongoDB 3.4+ and will result in an exception at
44-
execution time if specified for an older server version.
45-
interface: phpmethod
46-
operation: ~
47-
optional: true
4835
---
4936
arg_name: option
5037
name: readConcern

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

Lines changed: 19 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,19 @@
11
---
2-
arg_name: option
3-
name: batchSize
4-
type: integer
5-
description: |
6-
Specifies the maximum number of change events to return in each batch of the
7-
response from the MongoDB cluster.
8-
interface: phpmethod
9-
operation: ~
10-
optional: true
2+
source:
3+
file: apiargs-method-watch-option.yaml
4+
ref: batchSize
115
---
126
source:
13-
file: apiargs-MongoDBCollection-common-option.yaml
7+
file: apiargs-common-option.yaml
148
ref: collation
159
---
16-
arg_name: option
17-
name: fullDocument
18-
type: string
19-
description: |
20-
Allowed values are 'default' and 'updateLookup'. Defaults to 'default'.
21-
When set to 'updateLookup', the change notification for partial updates will
22-
include both a delta describing the changes to the document, as well as a
23-
copy of the entire document that was changed from some time after the change
24-
occurred. The following values are supported:
25-
26-
- ``MongoDB\Operation\Watch::FULL_DOCUMENT_DEFAULT`` (*default*)
27-
- ``MongoDB\Operation\Watch::FULL_DOCUMENT_UPDATE_LOOKUP``
28-
29-
.. note::
30-
31-
This is an option of the ``$changeStream`` pipeline stage.
32-
interface: phpmethod
33-
operation: ~
34-
optional: true
10+
source:
11+
file: apiargs-method-watch-option.yaml
12+
ref: fullDocument
3513
---
36-
arg_name: option
37-
name: maxAwaitTimeMS
38-
type: integer
39-
description: |
40-
Positive integer denoting the time limit in milliseconds for the server to
41-
block a getMore operation if no data is available.
42-
interface: phpmethod
43-
operation: ~
44-
optional: true
14+
source:
15+
file: apiargs-method-watch-option.yaml
16+
ref: maxAwaitTimeMS
4517
---
4618
source:
4719
file: apiargs-MongoDBCollection-common-option.yaml
@@ -54,23 +26,20 @@ post: |
5426
This is used for both the initial change stream aggregation and for
5527
server selection during an automatic resume.
5628
---
57-
arg_name: option
58-
name: resumeAfter
59-
type: array|object
60-
description: |
61-
Specifies the logical starting point for the new change stream.
62-
63-
.. note::
64-
65-
This is an option of the ``$changeStream`` pipeline stage.
66-
interface: phpmethod
67-
operation: ~
68-
optional: true
29+
source:
30+
file: apiargs-method-watch-option.yaml
31+
ref: resumeAfter
6932
---
7033
source:
7134
file: apiargs-common-option.yaml
7235
ref: session
7336
---
37+
source:
38+
file: apiargs-method-watch-option.yaml
39+
ref: startAtOperationTime
40+
post: |
41+
.. versionadded:: 1.4
42+
---
7443
source:
7544
file: apiargs-MongoDBCollection-common-option.yaml
7645
ref: typeMap
Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
1-
arg_name: param
2-
name: $pipeline
3-
type: array|object
4-
description: |
5-
The pipeline of stages to append to an initial ``$changeStream`` stage.
6-
interface: phpmethod
7-
operation: ~
8-
optional: true
1+
source:
2+
file: apiargs-method-watch-param.yaml
3+
ref: $pipeline
94
---
105
source:
11-
file: apiargs-common-param.yaml
6+
file: apiargs-method-watch-param.yaml
127
ref: $options
138
...

docs/includes/apiargs-MongoDBDatabase-common-option.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,26 @@
1+
arg_name: option
2+
name: readConcern
3+
type: :php:`MongoDB\\Driver\\ReadConcern <class.mongodb-driver-readconcern>`
4+
description: |
5+
:manual:`Read concern </reference/read-concern>` to use for the operation.
6+
Defaults to the database's read concern.
7+
8+
This is not supported for server versions prior to 3.2 and will result in an
9+
exception at execution time if used.
10+
interface: phpmethod
11+
operation: ~
12+
optional: true
13+
---
14+
arg_name: option
15+
name: readPreference
16+
type: :php:`MongoDB\\Driver\\ReadPreference <class.mongodb-driver-readpreference>`
17+
description: |
18+
:manual:`Read preference </reference/read-preference>` to use for the
19+
operation. Defaults to the database's read preference.
20+
interface: phpmethod
21+
operation: ~
22+
optional: true
23+
---
124
source:
225
file: apiargs-common-option.yaml
326
ref: typeMap

docs/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ operation: ~
2828
optional: true
2929
---
3030
source:
31-
file: apiargs-MongoDBCollection-common-option.yaml
31+
file: apiargs-common-option.yaml
3232
ref: collation
3333
pre: |
3434
Specifies the :manual:`collation
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
source:
3+
file: apiargs-method-watch-option.yaml
4+
ref: batchSize
5+
---
6+
source:
7+
file: apiargs-common-option.yaml
8+
ref: collation
9+
---
10+
source:
11+
file: apiargs-method-watch-option.yaml
12+
ref: fullDocument
13+
---
14+
source:
15+
file: apiargs-method-watch-option.yaml
16+
ref: maxAwaitTimeMS
17+
---
18+
source:
19+
file: apiargs-MongoDBDatabase-common-option.yaml
20+
ref: readConcern
21+
---
22+
source:
23+
file: apiargs-MongoDBDatabase-common-option.yaml
24+
ref: readPreference
25+
post: |
26+
This is used for both the initial change stream aggregation and for
27+
server selection during an automatic resume.
28+
---
29+
source:
30+
file: apiargs-method-watch-option.yaml
31+
ref: resumeAfter
32+
---
33+
source:
34+
file: apiargs-common-option.yaml
35+
ref: session
36+
---
37+
source:
38+
file: apiargs-method-watch-option.yaml
39+
ref: startAtOperationTime
40+
---
41+
source:
42+
file: apiargs-MongoDBDatabase-common-option.yaml
43+
ref: typeMap
44+
...
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
source:
2+
file: apiargs-method-watch-param.yaml
3+
ref: $pipeline
4+
---
5+
source:
6+
file: apiargs-method-watch-param.yaml
7+
ref: $options
8+
...

docs/includes/apiargs-common-option.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,21 @@
11
arg_name: option
2+
name: collation
3+
type: array|object
4+
description: |
5+
:manual:`Collation </reference/collation>` allows users to specify
6+
language-specific rules for string comparison, such as rules for lettercase
7+
and accent marks. When specifying collation, the ``locale`` field is
8+
mandatory; all other collation fields are optional. For descriptions of the
9+
fields, see :manual:`Collation Document
10+
</reference/collation/#collation-document>`.
11+
12+
This option is available in MongoDB 3.4+ and will result in an exception at
13+
execution time if specified for an older server version.
14+
interface: phpmethod
15+
operation: ~
16+
optional: true
17+
---
18+
arg_name: option
219
name: maxTimeMS
320
type: integer
421
description: |

0 commit comments

Comments
 (0)