New in version 3.2.
Marks the cursor as tailable.
cursor.tailable()uses the following syntax:
tailable()has the following parameter:
Parameter Type Description
Returns: The cursor that
tailable()is attached to.
A tailable cursor performs a collection scan over a capped collection. It remains open even after reaching the end of the collection. Applications can continue to iterate the tailable cursor as new data is inserted into the collection.
awaitData is set to
true, when the cursor reaches the end of the capped collection, MongoDB blocks the query thread for a period of time waiting for new data to arrive. When new data is inserted into the capped collection, the blocked thread is signaled to wake up and return the next batch to the client.
See Tailable Cursors.