Skip to content

Commit 08f7944

Browse files
authored
Find operation fixes (#76)
1 parent ef51d9a commit 08f7944

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed

source/usage-examples/find.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ learn more about using cursors, see the :ref:`rust-cursor-guide` guide.
2525
Example
2626
-------
2727

28-
This example retrieves documents from the ``restaurants`` collection in the
29-
``sample_restaurants`` database that match a query filter. The example uses a
30-
``Restaurant`` struct that has ``name`` and ``cuisine`` fields to model the documents
31-
in the collection.
28+
This example retrieves documents that match a query filter from the ``restaurants``
29+
collection in the ``sample_restaurants`` database. The example uses a ``Restaurant``
30+
struct that has ``name`` and ``cuisine`` fields to model the documents in the
31+
collection.
3232

33-
The following code passes a query filter as a parameter to the ``find()`` method. The
34-
filter matches documents in which the value of the ``cuisine`` field is ``"French"``.
33+
The following code uses a query filter that matches documents in which the value
34+
of the ``cuisine`` field is ``"French"``.
3535

3636
Select the **Asynchronous** or **Synchronous** tab to see the
3737
corresponding code for each runtime:

source/usage-examples/findOne.txt

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,14 @@ You can retrieve a single document in a collection by calling the `find_one()
99

1010
Pass a query filter to the ``find_one()`` method to return one document in the collection
1111
that matches the filter. If multiple documents match the query filter, this method returns
12-
the first matching document according to their :term:`natural order` in the database, or
12+
the first matching document according to their :term:`natural order` in the database or
1313
according to the sort order specified in a ``FindOneOptions`` instance.
1414

15-
The ``find_one()`` method returns a `Result<Option<T>> <{+api+}/error/type.Result.html>`__
16-
type.
15+
The ``find_one()`` method returns an `Option<T> <https://doc.rust-lang.org/nightly/core/option/enum.Option.html>`__
16+
type, where ``<T>`` is the type with which you parameterized your ``Collection``
17+
instance.
1718

18-
.. tip::
19-
20-
To learn more about retrieving documents, see the :ref:`rust-retrieve-guide` guide.
19+
To learn more about retrieving documents, see the :ref:`rust-retrieve-guide` guide.
2120

2221
Example
2322
-------

0 commit comments

Comments
 (0)