Get the next element in the cursor.
wait argument specifies whether to wait for the next available element and how long to wait:
True: Wait indefinitely (the default).
False: Do not wait at all. If data is immediately available, it will be returned; if it is not available, a
ReqlTimeoutErrorwill be raised.
The behavior of
next will be identical with
None or the number
next the first time on a cursor provides the first element of the cursor. If the data set is exhausted (e.g., you have retrieved all the documents in a table), a
ReqlCursorEmpty error will be raised when
next is called.
Example: Retrieve the next element.
cursor = r.table('superheroes').run(conn) doc = cursor.next()
Example: Retrieve the next element on a changefeed, waiting up to five seconds.
cursor = r.table('superheroes').changes().run(conn) doc = cursor.next(wait=5)
Couldn't find what you were looking for?
© RethinkDB contributors
Licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported License.