Skip to content

Commit 82b2292

Browse files
committed
DOCSP-43951: v2 remove deprecated find opts
1 parent 2a9dea4 commit 82b2292

File tree

7 files changed

+294
-694
lines changed

7 files changed

+294
-694
lines changed
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
``$filter`` : array|object
2+
The filter criteria that specifies the documents to query.
3+
4+
``$options`` : array
5+
An array specifying the desired options.
6+
7+
.. list-table::
8+
:header-rows: 1
9+
:widths: 20 20 80
10+
11+
* - Name
12+
- Type
13+
- Description
14+
15+
* - allowDiskUse
16+
- boolean
17+
- Enables writing to temporary files. When set to ``true``, queries can
18+
write data to the ``_tmp`` sub-directory in the ``dbPath`` directory.
19+
20+
* - allowPartialResults
21+
- boolean
22+
- For queries against a sharded collection, returns partial results from
23+
the :program:`mongos` if some shards are unavailable instead of
24+
throwing an error.
25+
26+
* - codec
27+
- MongoDB\\Codec\\DocumentCodec
28+
- .. include:: /includes/extracts/collection-option-codec.rst
29+
30+
.. versionadded:: 1.17
31+
32+
* - collation
33+
- array|object
34+
- .. include:: /includes/extracts/collection-option-collation.rst
35+
36+
* - comment
37+
- mixed
38+
- .. include:: /includes/extracts/common-option-comment.rst
39+
40+
.. include:: /includes/extracts/common-option-comment-string-before-4.4.rst
41+
42+
* - hint
43+
- string|array|object
44+
- .. include:: /includes/extracts/common-option-hint.rst
45+
46+
.. versionadded:: 1.2
47+
48+
* - let
49+
- array|object
50+
- .. include:: /includes/extracts/common-option-let.rst
51+
52+
.. versionadded:: 1.13
53+
54+
* - max
55+
- array|object
56+
- The exclusive upper bound for a specific index.
57+
58+
.. versionadded:: 1.2
59+
60+
* - maxTimeMS
61+
- integer
62+
- .. include:: /includes/extracts/common-option-maxTimeMS.rst
63+
64+
* - min
65+
- array|object
66+
- The inclusive lower bound for a specific index.
67+
68+
.. versionadded:: 1.2
69+
70+
* - projection
71+
- array|object
72+
- The :ref:`projection specification <projections>` to determine which
73+
fields to include in the returned documents. See
74+
:manual:`Project Fields to Return from Query </tutorial/project-fields-from-query-results>`
75+
and :manual:`Projection Operators </reference/operator/projection>` in
76+
the MongoDB manual.
77+
78+
* - readConcern
79+
- :php:`MongoDB\Driver\ReadConcern <class.mongodb-driver-readconcern>`
80+
- .. include:: /includes/extracts/collection-option-readConcern.rst
81+
82+
.. include:: /includes/extracts/common-option-readConcern-transaction.rst
83+
84+
* - readPreference
85+
- :php:`MongoDB\Driver\ReadPreference <class.mongodb-driver-readpreference>`
86+
- .. include:: /includes/extracts/collection-option-readPreference.rst
87+
88+
* - returnKey
89+
- boolean
90+
- If true, returns only the index keys in the resulting documents.
91+
92+
.. versionadded:: 1.2
93+
94+
* - session
95+
- :php:`MongoDB\Driver\Session <class.mongodb-driver-session>`
96+
- .. include:: /includes/extracts/common-option-session.rst
97+
98+
.. versionadded:: 1.3
99+
100+
* - showRecordId
101+
- boolean
102+
- Determines whether to return the record identifier for each document.
103+
If true, adds a field ``$recordId`` to the returned documents.
104+
105+
.. versionadded:: 1.2
106+
107+
* - skip
108+
- integer
109+
- Number of documents to skip. Defaults to ``0``.
110+
111+
* - sort
112+
- array|object
113+
- The sort specification for the ordering of the results.
114+
115+
* - typeMap
116+
- array
117+
- .. include:: /includes/extracts/collection-option-typeMap.rst
118+
119+
This will be used for the returned result document.
Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
``$filter`` : array|object
2+
The filter criteria that specifies the documents to query.
3+
4+
``$options`` : array
5+
An array specifying the desired options.
6+
7+
.. list-table::
8+
:header-rows: 1
9+
:widths: 20 20 80
10+
11+
* - Name
12+
- Type
13+
- Description
14+
15+
* - allowDiskUse
16+
- boolean
17+
- Enables writing to temporary files. When set to ``true``, queries can
18+
write data to the ``_tmp`` sub-directory in the ``dbPath`` directory.
19+
20+
* - allowPartialResults
21+
- boolean
22+
- For queries against a sharded collection, returns partial results from
23+
the :program:`mongos` if some shards are unavailable instead of
24+
throwing an error.
25+
26+
* - batchSize
27+
- integer
28+
- The number of documents to return in the first batch. Defaults to
29+
``101``. A batchSize of ``0`` means that the cursor will be
30+
established, but no documents will be returned in the first batch.
31+
32+
Unlike the previous wire protocol version, a batchSize of ``1`` for the
33+
:dbcommand:`find` command does not close the cursor.
34+
35+
* - codec
36+
- MongoDB\\Codec\\DocumentCodec
37+
- .. include:: /includes/extracts/collection-option-codec.rst
38+
39+
.. versionadded:: 1.17
40+
41+
* - collation
42+
- array|object
43+
- .. include:: /includes/extracts/collection-option-collation.rst
44+
45+
* - comment
46+
- mixed
47+
- .. include:: /includes/extracts/common-option-comment.rst
48+
49+
.. include:: /includes/extracts/common-option-comment-string-before-4.4.rst
50+
51+
* - cursorType
52+
- integer
53+
- Indicates the type of cursor to use. ``cursorType`` supports the
54+
following values:
55+
56+
- ``MongoDB\Operation\Find::NON_TAILABLE`` (*default*)
57+
- ``MongoDB\Operation\Find::TAILABLE``
58+
59+
* - hint
60+
- string|array|object
61+
- .. include:: /includes/extracts/common-option-hint.rst
62+
63+
.. versionadded:: 1.2
64+
65+
* - let
66+
- array|object
67+
- .. include:: /includes/extracts/common-option-let.rst
68+
69+
.. versionadded:: 1.13
70+
71+
* - limit
72+
- integer
73+
- The maximum number of documents to return. If unspecified, then
74+
defaults to no limit. A limit of ``0`` is equivalent to setting no
75+
limit.
76+
77+
A negative limit is similar to a positive limit but closes the cursor
78+
after returning a single batch of results. As such, with a negative
79+
limit, if the limited result set does not fit into a single batch, the
80+
number of documents received will be less than the specified limit. By
81+
passing a negative limit, the client indicates to the server that it
82+
will not ask for a subsequent batch via getMore.
83+
84+
* - max
85+
- array|object
86+
- The exclusive upper bound for a specific index.
87+
88+
.. versionadded:: 1.2
89+
90+
* - maxAwaitTimeMS
91+
- integer
92+
- Positive integer denoting the time limit in milliseconds for the server
93+
to block a getMore operation if no data is available. This option
94+
should only be used if cursorType is ``TAILABLE_AWAIT``.
95+
96+
.. versionadded:: 1.2
97+
98+
* - maxTimeMS
99+
- integer
100+
- .. include:: /includes/extracts/common-option-maxTimeMS.rst
101+
102+
* - min
103+
- array|object
104+
- The inclusive lower bound for a specific index.
105+
106+
.. versionadded:: 1.2
107+
108+
* - noCursorTimeout
109+
- boolean
110+
- Prevents the server from timing out idle cursors after an inactivity
111+
period (10 minutes).
112+
113+
* - projection
114+
- array|object
115+
- The :ref:`projection specification <projections>` to determine which
116+
fields to include in the returned documents. See
117+
:manual:`Project Fields to Return from Query </tutorial/project-fields-from-query-results>`
118+
and :manual:`Projection Operators </reference/operator/projection>` in
119+
the MongoDB manual.
120+
121+
* - readConcern
122+
- :php:`MongoDB\Driver\ReadConcern <class.mongodb-driver-readconcern>`
123+
- .. include:: /includes/extracts/collection-option-readConcern.rst
124+
125+
.. include:: /includes/extracts/common-option-readConcern-transaction.rst
126+
127+
* - readPreference
128+
- :php:`MongoDB\Driver\ReadPreference <class.mongodb-driver-readpreference>`
129+
- .. include:: /includes/extracts/collection-option-readPreference.rst
130+
131+
* - returnKey
132+
- boolean
133+
- If true, returns only the index keys in the resulting documents.
134+
135+
.. versionadded:: 1.2
136+
137+
* - session
138+
- :php:`MongoDB\Driver\Session <class.mongodb-driver-session>`
139+
- .. include:: /includes/extracts/common-option-session.rst
140+
141+
.. versionadded:: 1.3
142+
143+
* - showRecordId
144+
- boolean
145+
- Determines whether to return the record identifier for each document.
146+
If true, adds a field ``$recordId`` to the returned documents.
147+
148+
.. versionadded:: 1.2
149+
150+
* - skip
151+
- integer
152+
- Number of documents to skip. Defaults to ``0``.
153+
154+
* - sort
155+
- array|object
156+
- The sort specification for the ordering of the results.
157+
158+
* - typeMap
159+
- array
160+
- .. include:: /includes/extracts/collection-option-typeMap.rst

0 commit comments

Comments
 (0)