@@ -52,8 +52,12 @@ This section describes how to skip results retrieved by a query in the following
5252- :ref:`skip() method <rust-skip-method>`: Chain the ``skip()`` method to the
5353 ``find()`` method
5454- :ref:`FindOptions::skip() method <rust-findoptions-skip>`: Use the ``skip()``
55- method of the ``FindOptions`` struct if you are setting and reusing options
56- for your query
55+ method of the ``FindOptions`` struct
56+
57+ Alternatively, you can :ref:`skip documents in an aggregation pipeline
58+ <rust-aggregation-skip>`.
59+
60+ When you skip documents, the driver omits the specified number of documents from
5761
5862If the number of skipped documents exceeds the number of matched documents for a
5963query, then that query returns no documents.
@@ -69,7 +73,7 @@ skip() Method Example
6973~~~~~~~~~~~~~~~~~~~~~~
7074
7175The ``skip()`` method takes an integer that specifies the number of documents to
72- omit from the beginning of the result set. You can chain the ``skip()`` method
76+ omit from the beginning of the result set. Chain the ``skip()`` method
7377to the ``find()`` method to skip documents.
7478
7579This example runs a ``find()`` operation that performs the following actions:
@@ -99,7 +103,8 @@ This example runs a ``find()`` operation that performs the following actions:
99103Options Example
100104~~~~~~~~~~~~~~~
101105
102- Alternatively, you can set the ``skip`` field of the ``FindOptions`` struct by
106+ Alternatively, if you are setting and reusing options for your query, you can
107+ use ``FindOptions``. Set the ``skip`` field of the ``FindOptions`` struct by
103108using the ``skip()`` setter method. Then, chain the ``with_options()`` method to
104109the ``find()`` method and pass your ``FindOptions`` struct as a parameter to the
105110``with_options()`` method.
@@ -127,15 +132,14 @@ This example runs a ``find()`` operation that performs the following actions:
127132 Book { name: "Les Misérables", author: "Hugo", length: 1462 }
128133 Book { name: "Atlas Shrugged", author: "Rand", length: 1088 }
129134
130- Aggregation
131- ~~~~~~~~~~~
135+ .. _rust-aggregation-skip:
136+
137+ Aggregation Example
138+ ~~~~~~~~~~~~~~~~~~~
132139
133140You can use the ``$skip`` stage in an aggregation pipeline to skip documents. To
134141learn more, see the :ref:`rust-aggregation` guide.
135142
136- Example
137- ~~~~~~~
138-
139143This example runs an aggregation pipeline that performs the following actions:
140144
141145- Sorts the results in ascending order on the ``author`` field
0 commit comments