@@ -160,8 +160,9 @@ The :method:`db.collection.explain()` method wraps the
160160
161161.. include:: /includes/fact-explain-methods-differences.rst
162162
163- :method:`db.collection.explain().aggregate() <db.collection.explain()>` is equivalent to passing
164- the :ref:`explain <example-aggregate-method-explain-option>` option to
163+ :method:`db.collection.explain().aggregate() <db.collection.explain()>`
164+ is equivalent to passing the
165+ :ref:`explain <example-aggregate-method-explain-option>` option to
165166the :method:`db.collection.aggregate()` method.
166167
167168.. _explain-method-help:
@@ -176,10 +177,11 @@ To see the list of operations supported by
176177
177178 db.collection.explain().help()
178179
179- :method:`db.collection.explain().find() <db.collection.explain()>` returns a cursor, which allows
180- for the chaining of query modifiers. To see the list of query modifiers
181- supported by :method:`db.collection.explain().find()
182- <db.collection.explain()>` as well as cursor-related methods, run:
180+ :method:`db.collection.explain().find() <db.collection.explain()>`
181+ returns a cursor, which allows for the chaining of query modifiers.
182+ To see the list of query modifiers supported by
183+ :method:`db.collection.explain().find() <db.collection.explain()>` as
184+ well as cursor-related methods, run:
183185
184186.. code-block:: javascript
185187
@@ -188,6 +190,15 @@ supported by :method:`db.collection.explain().find()
188190You can chain multiple modifiers to ``db.collection.explain().find()``.
189191For an example, see :ref:`explain-find-modifiers`.
190192
193+ .. _explain-collection-method-output:
194+
195+ Output
196+ ------
197+
198+ .. include:: /includes/fact-explain-results-categories.rst
199+
200+ For details on the output, see :doc:`/reference/explain-results`.
201+
191202.. _explain-method-examples:
192203
193204Examples
@@ -250,9 +261,10 @@ all considered plans for the specified
250261Explain ``find()`` with Modifiers
251262~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
252263
253- :method:`db.collection.explain().find() <db.collection.explain()>` construct allows for the
254- chaining of query modifiers. For example, the following operation
255- provides information on the :method:`~db.collection.find()` method with
264+ :method:`db.collection.explain().find() <db.collection.explain()>`
265+ construct allows for the chaining of query modifiers. For example, the
266+ following operation provides information on the
267+ :method:`~db.collection.find()` method with
256268:method:`~cursor.sort()` and :method:`~cursor.hint()` query modifiers.
257269
258270.. code-block:: javascript
@@ -271,22 +283,14 @@ shell:
271283Iterate the ``explain().find()`` Return Cursor
272284~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
273285
274- :method:`db.collection.explain().find() <db.collection.explain()>` returns a cursor to the
275- explain results. If run interactively in the :binary:`~bin.mongo` shell,
276- the :binary:`~bin.mongo` shell automatically iterates the cursor using the
277- ``.next()`` method. For scripts, however, you must explicitly call
278- ``.next()`` (or its alias ``.finish()``) to return the results:
286+ :method:`db.collection.explain().find() <db.collection.explain()>`
287+ returns a cursor to the explain results. If run interactively in the
288+ :binary:`~bin.mongo` shell, the :binary:`~bin.mongo` shell automatically
289+ iterates the cursor using the ``.next()`` method. For scripts, however,
290+ you must explicitly call ``.next()`` (or its alias ``.finish()``) to
291+ return the results:
279292
280293.. code-block:: javascript
281294
282295 var explainResult = db.products.explain().find( { category: "apparel" } ).next();
283296
284- .. _explain-collection-method-output:
285-
286- Output
287- ------
288-
289- .. include:: /includes/fact-explain-results-categories.rst
290-
291- For details on the output, see :doc:`/reference/explain-results`.
292-
0 commit comments