@@ -3,3 +3,54 @@ Find Multiple Documents
3
3
=======================
4
4
5
5
.. default-domain:: mongodb
6
+
7
+ You can find multiple documents in a collection by using the ``Find()``
8
+ method.
9
+
10
+ The following example passes a query filter to the ``Find()`` method,
11
+ which matches documents in the ``zips`` collection where the value of the
12
+ ``pop`` field is less than or equal to *500*:
13
+
14
+ .. include:: /includes/run-example-tip.rst
15
+
16
+ .. literalinclude:: /code-snippets/find.go
17
+ :start-after: begin find
18
+ :end-before: end find
19
+ :emphasize-lines: 4
20
+ :language: go
21
+ :dedent:
22
+
23
+ Click here **<TODO: github link to file>** to see a fully runnable example.
24
+
25
+ Expected Result
26
+ ---------------
27
+
28
+ This example creates a ``Cursor`` object that returns
29
+ documents similar to these:
30
+
31
+ .. code-block:: json
32
+ :copyable: false
33
+
34
+ // results truncated
35
+ ...
36
+ { ... , "city" : "SHAKTOOLIK", ... , "pop" : 183, "state" : "AK" },
37
+ { ... , "city" : "DARLINGTON", ... , "pop" : 12, "state" : "ID" },
38
+ { ... , "city" : "EAST BARRE", ... , "pop" : 381, "state" : "VT" },
39
+ ...
40
+
41
+ Additional Information
42
+ ----------------------
43
+
44
+ For more information on specifying query filters and
45
+ handling potential errors, see our guide on **<TODO: retrieve data
46
+ fundamental page>**.
47
+
48
+ For more information on query operators,
49
+ see the :manual:`MongoDB query operator reference documentation
50
+ </reference/operator/query/>`.
51
+
52
+ API Documentation
53
+ ~~~~~~~~~~~~~~~~~
54
+
55
+ - `Find() <https://pkg.go.dev/go.mongodb.org/
[email protected] /mongo#Collection.Find>`_
56
+ - `Cursor <https://pkg.go.dev/go.mongodb.org/
[email protected] /mongo#Cursor>`_
0 commit comments