From f598c814ccbd4399e8771695dc4ded2795ccf4eb Mon Sep 17 00:00:00 2001 From: kay Date: Fri, 12 Apr 2013 11:24:46 -0400 Subject: [PATCH] DOCS-1040 addOption edits --- source/reference/method/cursor.addOption.txt | 31 ++++++++++++-------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/source/reference/method/cursor.addOption.txt b/source/reference/method/cursor.addOption.txt index ca51c5638b4..7dbc9ab9626 100644 --- a/source/reference/method/cursor.addOption.txt +++ b/source/reference/method/cursor.addOption.txt @@ -7,28 +7,33 @@ cursor.addOption() .. method:: cursor.addOption() Use the :method:`cursor.addOption()` method on a cursor to add - ``OP_QUERY`` wire protocol flags, such as the ``tailable`` flag. + ``OP_QUERY`` wire protocol flags, such as the ``tailable`` flag, to + change the behavior of queries. :param flag: ``OP_QUERY`` wire protocol flag. See :meta-driver:`MongoDB - wire protocol ` for more - information on MongoDB Wire Protocols and the OP_QUERY - flags. + wire protocol + ` + for more information on MongoDB Wire Protocols and + the OP_QUERY flags. - For the :program:`mongo` shell, see the list of :ref:`cursor flags - ` available in the shell. For the driver-specific - list, see your :doc:`driver documentation `. + For the :program:`mongo` shell, you can use the cursor + flags listed in the :ref:`cursor-flags` section. For + the driver-specific list, see your :doc:`driver + documentation `. The following example in the :program:`mongo` shell adds the - ``DBQuery.Option.tailable`` flag to ensure the cursor returned from - the query is a tailable cursor: + ``DBQuery.Option.tailable`` flag and the + ``DBQuery.Option.awaitData`` flag to ensure that the cursor returned + from the query is a tailable cursor that waits for a few seconds for + new data when you reach the end of the data: .. code-block:: javascript var t = db.myCappedCollection; - var cursor = t.find().addOption(DBQuery.Option.tailable); + var cursor = t.find().addOption(DBQuery.Option.tailable). + addOption(DBQuery.Option.awaitData) + + .. warning:: - .. warning:: - Adding incorrect wire protocol flags can cause problems and/or extra server load. -