@@ -778,12 +778,18 @@ Consider the following behaviors related to cursors:
778
778
779
779
- By default, the server will automatically close the cursor after 10
780
780
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
782
782
protocol flag <Mongo Wire Protocol>` in your query; however, you
783
783
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.
787
793
788
794
- Because the cursor is not isolated during its lifetime, intervening
789
795
write operations may cause a document to be returned multiple times.
@@ -841,6 +847,17 @@ Consider the following behaviors related to cursors:
841
847
842
848
{ "totalOpen" : <number>, "clientCursors_size" : <number>, "timedOut" : <number>, "ok" : 1 }
843
849
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
+
844
861
.. _read-operations-aggregation:
845
862
846
863
Aggregation
0 commit comments