File tree Expand file tree Collapse file tree 4 files changed +115
-0
lines changed Expand file tree Collapse file tree 4 files changed +115
-0
lines changed Original file line number Diff line number Diff line change 1+ source :
2+ file : apiargs-MongoDBCollection-method-aggregate-option.yaml
3+ ref : batchSize
4+ ---
5+ source :
6+ file : apiargs-MongoDBCollection-common-option.yaml
7+ ref : collation
8+ ---
9+ arg_name : option
10+ name : fullDocument
11+ type : string
12+ description : |
13+ Allowed values are 'default' and 'updateLookup'. Defaults to 'default'.
14+ When set to 'updateLookup', the change notification for partial updates will
15+ include both a delta describing the changes to the document, as well as a
16+ copy of the entire document that was changed from some time after the change
17+ occurred. The following values are supported:
18+
19+ - ``MongoDB\Operation\ChangeStream::FULL_DOCUMENT_DEFAULT`` (*default*)
20+ - ``MongoDB\Operation\ChangeStream::FULL_DOCUMENT_UPDATE_LOOKUP``
21+ interface : phpmethod
22+ operation : ~
23+ optional : true
24+ ---
25+ source :
26+ file : apiargs-MongoDBCollection-method-find-option.yaml
27+ ref : maxAwaitTimeMS
28+ ---
29+ arg_name : option
30+ name : readPreference
31+ type : :php:`MongoDB\\Driver\\ReadPreference <class.mongodb-driver-readpreference>`
32+ description : |
33+ The read preference for the initial change stream aggregation, used for
34+ server selection during an automatic resume.
35+ interface : phpmethod
36+ operation : ~
37+ optional : true
38+ ---
39+ arg_name : option
40+ name : resumeAfter
41+ type : array|object
42+ description : |
43+ Specifies the logical starting point for the new change stream.
44+
45+ Note this is an option of the '$changeStream' pipeline stage.
46+ interface : phpmethod
47+ operation : ~
48+ optional : true
49+ ...
Original file line number Diff line number Diff line change 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
9+ ---
10+ source :
11+ file : apiargs-common-param.yaml
12+ ref : $options
13+ ...
Original file line number Diff line number Diff line change @@ -91,4 +91,5 @@ Methods
9191 /reference/method/MongoDBCollection-replaceOne
9292 /reference/method/MongoDBCollection-updateMany
9393 /reference/method/MongoDBCollection-updateOne
94+ /reference/method/MongoDBCollection-watch
9495 /reference/method/MongoDBCollection-withOptions
Original file line number Diff line number Diff line change 1+ ================================
2+ MongoDB\\Collection::watch()
3+ ================================
4+
5+ .. default-domain:: mongodb
6+
7+ .. contents:: On this page
8+ :local:
9+ :backlinks: none
10+ :depth: 1
11+ :class: singlecol
12+
13+ Definition
14+ ----------
15+
16+ .. phpmethod:: MongoDB\\Collection::watch()
17+
18+ Executes a :manual:`change stream </changeStreams>` operation on the
19+ collection.
20+
21+ .. code-block:: php
22+
23+ function watch(array $pipeline = [], array $options = []): MongoDB\ChangeStream
24+
25+ This method has the following parameters:
26+
27+ .. include:: /includes/apiargs/MongoDBCollection-method-watch-param.rst
28+
29+ The ``$options`` parameter supports the following options:
30+
31+ .. include:: /includes/apiargs/MongoDBCollection-method-watch-option.rst
32+
33+ Return Values
34+ -------------
35+
36+ A :phpclass:`MongoDB\\ChangeStream` object, which allows for iteration of
37+ events in the change stream via the :php:`Iterator <class.iterator>` interface.
38+
39+ Errors/Exceptions
40+ -----------------
41+
42+ .. include:: /includes/extracts/error-unexpectedvalueexception.rst
43+ .. include:: /includes/extracts/error-unsupportedexception.rst
44+ .. include:: /includes/extracts/error-invalidargumentexception.rst
45+ .. include:: /includes/extracts/error-driver-runtimeexception.rst
46+
47+ See Also
48+ --------
49+
50+ - :manual:`Aggregation Pipeline </core/aggregation-pipeline>` documentation in
51+ the MongoDB Manual
52+ - :manual:`Change Streams </changeStreams>` documentation in the MongoDB manual
You can’t perform that action at this time.
0 commit comments