mongo_insert
mongo_query
Mongo Функции
PHP Manual

# mongo_next

(PECL mongo >= 0.8.0)

mongo_next — Fetches the next document returned by a query

### Описание

array mongo_next ( resource `$cursor` )

Fetches the next document returned by a query.

### Список параметров

`cursor`

  The cursor to use.

### Возвращаемые значения

The next document.

### Errors/Exceptions

Creates an error if there are no more documents.

### Примеры

Пример #1 mongo_next() example

This example uses mongo_has_next and mongo_next to iterate through query results and storing them in an array.

`<?php
$conn = mongo_connect("localhost", true);
if (!$conn) {
die("Could not connect.");
}
$cursor = mongo_query($conn, "foo.bar", array(), 0, 0, null, null, null);
$results = array();
while (mongo_has_next($cursor)) {
$results[] = mongo_next($cursor);
}
?>`

### Смотрите также

- mongo_has_next() - Checks if a cursor has any more documents to return

mongo_insert
mongo_query
Mongo Функции
PHP Manual