Skip to content

Commit 4ff79fa

Browse files
committed
DOCS-675 migrate queries and cursors
1 parent 467f5c9 commit 4ff79fa

File tree

1 file changed

+21
-4
lines changed

1 file changed

+21
-4
lines changed

source/core/read-operations.txt

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -778,12 +778,18 @@ Consider the following behaviors related to cursors:
778778

779779
- By default, the server will automatically close the cursor after 10
780780
minutes of inactivity or if the cursor has been exhausted. To
781-
override this behavior, you can specify the "noTimeout" :wiki:`wire
781+
override this behavior, you can specify the ``noTimeout`` :wiki:`wire
782782
protocol flag <Mongo Wire Protocol>` in your query; however, you
783783
should either close the cursor manually or exhaust the cursor. In the
784-
:program:`mongo` shell, you can set the "noTimeout" flag. See your
785-
:doc:`driver </applications/drivers>` documentation for information
786-
on setting the "noTimeout" option.
784+
:program:`mongo` shell, you can set the ``noTimeout`` flag
785+
[#queryOptions]_:
786+
787+
.. code-block:: javascript
788+
789+
var myCursor = db.inventory.find().addOption(DBQuery.Option.noTimeout);
790+
791+
See your :doc:`driver </applications/drivers>` documentation for
792+
information on setting the ``noTimeout`` flag.
787793

788794
- Because the cursor is not isolated during its lifetime, intervening
789795
write operations may cause a document to be returned multiple times.
@@ -841,6 +847,17 @@ Consider the following behaviors related to cursors:
841847

842848
{ "totalOpen" : <number>, "clientCursors_size" : <number>, "timedOut" : <number>, "ok" : 1 }
843849

850+
.. [#queryOptions] In the :program:`mongo` shell, the cursor flags
851+
available are:
852+
853+
- ``DBQuery.Option.tailable``
854+
- ``DBQuery.Option.slaveOk``
855+
- ``DBQuery.Option.oplogReplay``
856+
- ``DBQuery.Option.noTimeout``
857+
- ``DBQuery.Option.awaitData``
858+
- ``DBQuery.Option.exhaust``
859+
- ``DBQuery.Option.partial``
860+
844861
.. _read-operations-aggregation:
845862

846863
Aggregation

0 commit comments

Comments
 (0)