@@ -52,19 +52,22 @@ track of the color and quantity, which corresponds to the ``color`` and
5252Find Operation
5353--------------
5454
55- Use the find operation to retrieve a subset of your existing data in
56- MongoDB. You can specify what data to return including which documents
57- to retrieve, in what order to retrieve them, and how many to retrieve.
55+ Use the find operation to retrieve your documents from MongoDB. You can specify
56+ which documents to retrieve, in what order to retrieve them, and how many to
57+ retrieve.
5858
5959To perform a find operation, call the ``find()`` method on an instance
6060of a ``MongoCollection``. This method searches a collection for documents that
6161match the query filter you provide. For more information about how to
6262specify a query, see our :ref:`Specify a Query
6363<java-query>` guide.
6464
65- To retrieve a single document, you can append the ``first()`` method to your
66- ``find()`` operation. You can use the ``sort()`` operation before selecting the first
67- document to help choose the correct file.
65+ To retrieve a single document, you can add the ``first()`` method to your
66+ ``find()`` call. To choose a specific document, you can use the ``sort()``
67+ operation before selecting the first document. You may also want to use the
68+ ``limit()`` method to optimize memory usage. For more information, see the
69+ server manual for more information about :manual:`memory optimization when using
70+ the sort operation </reference/operator/aggregation/sort/#-sort----limit-memory-optimization>`.
6871
6972Example
7073~~~~~~~
@@ -116,9 +119,9 @@ This example is a complete, standalone file that performs the following actions:
116119 :language: none
117120 :visible: false
118121
119- Number of documents found with find(): 101
122+ 10 movies under 15 minutes: 10 Minutes, 3x3, 7:35 in the Morning, 8, 9, A Chairy Tale, A Corner in Wheat, A Gentle Spirit, A Is for Autism, A Movie,
120123
121- Document found with find().first() : {"title": "The Room ", "imdb": {"rating": 3.5 , "votes": 25673 , "id": 368226 }}
124+ The highest rated movie under 15 minutes : {"title": "Andrè and Wally B. ", "imdb": {"rating": 5.4 , "votes": 3294 , "id": 86855 }}
122125
123126.. _retrieve-aggregate:
124127
@@ -181,6 +184,7 @@ on this page, see the following API documentation:
181184
182185- `find() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoCollection.html#find()>`__
183186- `first() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoIterable.html#first()>`__
187+ - `limit() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/FindIterable.html#limit(int)>`__
184188- `FindIterable <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/FindIterable.html>`__
185189- `aggregate() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoCollection.html#aggregate(java.util.List)>`__
186190
@@ -190,4 +194,6 @@ Server Manual Entries
190194- :manual:`Collections </core/databases-and-collections/#collections>`
191195- :manual:`Query Documents </tutorial/query-documents>`
192196- :manual:`Aggregation </aggregation>`
197+ - :manual:`$sort </aggregation/sort>`
198+ - :manual:`$limit </aggregation/limit>`
193199- :manual:`Aggregation stages </meta/aggregation-quick-reference/#stages>`
0 commit comments