Skip to content

Commit 8b2398a

Browse files
committed
Apply review feedback to docs
1 parent ac6d9d5 commit 8b2398a

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

docs/tutorial/tailable-cursor.txt

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,25 +35,21 @@ While normal cursors can be iterated once with ``foreach``, that approach will
3535
not work with tailable cursors. When ``foreach`` is used with a tailable cursor,
3636
the loop will stop upon reaching the end of the initial result set. Attempting
3737
to continue iteration on the cursor with a second ``foreach`` would throw an
38-
exception, since PHP attempts to rewind the cursor.
39-
40-
In order to continuously read from a tailable cursor, we will need to directly
41-
control the cursor's iteration (e.g. call ``next()``), avoid inadvertently
42-
rewinding the cursor, and decide when to wait for new results or stop iteration
43-
entirely.
38+
exception, since PHP attempts to rewind the cursor. Therefore, reading from a
39+
tailable cursor will require direct usage of the :php:`Iterator <iterator>` API.
4440

4541
.. note::
4642

4743
Before version 1.9.0 of the ``ext-mongodb`` extension, the cursor class does
4844
not implement the :php:`Iterator <iterator>` interface. To manually iterate
49-
cursors using the method described below, cursors must be wrapped in a
45+
a cursor using the method below, it must first be wrapped with an
5046
:php:`IteratorIterator <iteratoriterator>`.
5147

5248
Manually Iterating a Normal Cursor
5349
----------------------------------
5450

5551
Before looking at how a tailable cursor can be iterated, we'll start by
56-
examining how the class interacts with a normal cursor.
52+
examining how the ``Iterator`` methods interact with a normal cursor.
5753

5854
The following example finds five restaurants and uses ``foreach`` to view the
5955
results:

0 commit comments

Comments
 (0)