File tree Expand file tree Collapse file tree 2 files changed +16
-13
lines changed Expand file tree Collapse file tree 2 files changed +16
-13
lines changed Original file line number Diff line number Diff line change @@ -4,13 +4,15 @@ Find Multiple Documents
4
4
5
5
.. default-domain:: mongodb
6
6
7
- You can query for multiple documents in a collection with
8
- ``collection.find()``. The ``find()`` method uses a query document that you
9
- provide to match the subset of the documents in the collection that match the
10
- query. If you don't provide a query document (or if you provide an empty
11
- document), MongoDB returns all documents in the collection. For more
12
- information on querying MongoDB, see our
13
- :doc:`documentation on query documents </fundamentals/crud/query-document>`.
7
+ You can query for multiple documents in a collection with the
8
+ ``collection.find()`` method. The ``find()`` method uses a query
9
+ document to determine what to include in the result set. A query
10
+ document can contain query operators. Query operators are keywords that
11
+ begin with a ``$`` that let you specify complex query behavior. If you
12
+ don't provide a query document or if you provide an empty document,
13
+ MongoDB returns all documents in the collection. For more information on
14
+ how to use query documents and query operators, see our :doc:`guide on query documents
15
+ </fundamentals/crud/query-document>`.
14
16
15
17
You can also define additional query options such as
16
18
:doc:`sort </fundamentals/crud/read-operations/sort>`
Original file line number Diff line number Diff line change @@ -14,12 +14,13 @@ Find a Document
14
14
15
15
You can query for a single document in a collection with the
16
16
``collection.findOne()`` method. The ``findOne()`` method uses a query
17
- document that you provide to match only the subset of the documents in the
18
- collection that match the query. If you don't provide a query document or if
19
- you provide an empty document, MongoDB matches all documents in the
20
- collection. The ``findOne()`` operation only returns the first matched
21
- document. For more information on querying MongoDB, see our
22
- :doc:`documentation on query documents </fundamentals/crud/query-document>`.
17
+ document to determine what to include in the result set. A query
18
+ document can contain query operators. Query operators are keywords that
19
+ begin with a ``$`` that let you specify complex query behavior. If you
20
+ don't provide a query document or if you provide an empty document,
21
+ MongoDB returns the first matched document. For more information on how
22
+ use query documents and query operators, see our :doc:`guide on query documents
23
+ </fundamentals/crud/query-document>`.
23
24
24
25
You can also define additional query options such as
25
26
:doc:`sort </fundamentals/crud/read-operations/sort>`
You can’t perform that action at this time.
0 commit comments