mongo_has_next
(PECL mongo >= 0.8.0)
mongo_has_next — Checks if a cursor has any more documents to return
Descrição
bool mongo_has_next
( resource $cursor
)
Checks if a cursor has any more documents to return.
Parâmetros
- cursor
-
The database cursor to check.
Valor Retornado
If there is another document to return.
Exemplos
Exemplo #1 mongo_has_next() example
This example shows how mongo_has_next can be used to iterate through results.
<?php
$conn = mongo_connect("localhost", true);
if (!$conn) {
die("Could not connect.");
}
$cursor = mongo_query($conn, "foo.bar", array(), 0, 0, null, null, null);
while (mongo_has_next($cursor)) {
mongo_next($cursor);
echo "."
}
?>
The above example will output a dot for each document in the collection foo.bar.
Veja Também
- mongo_query() - Performs a basic database query
- mongo_next() - Fetches the next document returned by a query
User Contributed Notes
mongo_has_next
mongo_has_next
There are no user contributed notes for this page.

mongo_gridfs_store