|
MongoCursor::awaitDataSets whether this cursor will wait for a while for a tailable cursor to return more data 説明
public MongoCursor MongoCursor::awaitData
([ bool
$wait = true
] )This method is to be used with tailable cursors. If we are at the end of the data, block for a while rather than returning no data. After a timeout period, we do return as normal. パラメータ
返り値Returns this cursor. エラー / 例外Throws MongoCursorException if this cursor has started iterating. 例例1 MongoCursor::awaitData example In this example we tail the "oplog" and instead of sleeping during every iteration, we set the MongoCursor::awaitData option. MongoCursor::hasNext will now block until there is more data available.
<?php |