File tree Expand file tree Collapse file tree 2 files changed +15
-15
lines changed Expand file tree Collapse file tree 2 files changed +15
-15
lines changed Original file line number Diff line number Diff line change @@ -549,12 +549,12 @@ the data returned by the query will reflect a single moment in time
549549
550550.. warning::
551551
552- You **cannot** use :method:`snapshot() <cursor.snapshot()>` with
553- :term:`sharded collections <sharding>`.
552+ - You **cannot** use :method:`snapshot() <cursor.snapshot()>` with
553+ :term:`sharded collections <sharding>`.
554554
555- You **cannot** use :method:`snapshot() <cursor.snapshot()>` with
556- :method:`sort() <cursor.sort()>` or :method:`hint()
557- <cursor.hint()>` cursor methods.
555+ - You **cannot** use :method:`snapshot() <cursor.snapshot()>` with
556+ :method:`sort() <cursor.sort()>` or :method:`hint()
557+ <cursor.hint()>` cursor methods.
558558
559559
560560As an alternative, if your collection has a field or fields that are
@@ -571,6 +571,6 @@ explicitly force the query to use that index.
571571 query; then the cursor will return the same document more than
572572 once.
573573
574- .. [#id-is-immutable] MongoDB does permit changes to the value of the
575- ``_id`` field, it is not possible for a cursor that transverses
574+ .. [#id-is-immutable] MongoDB does not permit changes to the value of the
575+ ``_id`` field; it is not possible for a cursor that transverses
576576 this index to pass the same document more than once.
Original file line number Diff line number Diff line change @@ -344,14 +344,14 @@ the following procedure:
344344
345345 { "_id" : ObjectId("4c220a42f3924d31102bd858"), "x" : 4, "j" : 3 }
346346
347- When you access documents in a cursor using on its indexed position
348- in an array , :program:`mongo` must iterate all documents with lower
349- index values.
350-
351- For example, if you access the document at ``c[4]``,
352- :program:`mongo` must load and iterate through the documents at
353- ``c[0]`` through ``c[3]`` in addition to ``c[4]``. For very large
354- result sets, :program:`mongo` may run out of available memory.
347+ When you access documents in a cursor using the array index
348+ notation , :program:`mongo` first calls the ``cursor.toArray()``
349+ method and loads into RAM all documents returned by the cursor. The
350+ index is then applied to the resulting array. This operation
351+ iterates the cursor completely and exhausts the cursor.
352+
353+ For very large result sets, :program:`mongo` may run out of
354+ available memory.
355355
356356For more information on the cursor, see :ref:`crud-read-cursor`.
357357
You can’t perform that action at this time.
0 commit comments