array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'tr', ), 'this' => array ( 0 => 'mongodb-driver-cursor.isdead.php', 1 => 'MongoDB\\Driver\\Cursor::isDead', 2 => 'Checks if the cursor is exhausted or may have additional results', ), 'up' => array ( 0 => 'class.mongodb-driver-cursor.php', 1 => 'MongoDB\\Driver\\Cursor', ), 'prev' => array ( 0 => 'mongodb-driver-cursor.getserver.php', 1 => 'MongoDB\\Driver\\Cursor::getServer', ), 'next' => array ( 0 => 'mongodb-driver-cursor.key.php', 1 => 'MongoDB\\Driver\\Cursor::key', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/mongodb/mongodb/driver/cursor/isdead.xml', ), 'history' => array ( ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); contributors($setup); ?>

MongoDB\Driver\Cursor::isDead

(mongodb >=1.0.0)

MongoDB\Driver\Cursor::isDeadChecks if the cursor is exhausted or may have additional results

Açıklama

final public MongoDB\Driver\Cursor::isDead(): bool

Checks whether there are definitely no additional results available on the cursor. This method is similar to the » cursor.isExhausted() method in the MongoDB shell and is primarily useful when iterating » tailable cursors.

A cursor has no additional results and is considered "dead" when one of the following is true:

By design, it is not possible to always determine whether a cursor has additional results. The cases where a cursor may have more data available is as follows:

Bağımsız Değişkenler

Bu işlevin bağımsız değişkeni yoktur.

Dönen Değerler

Returns true if there are definitely no additional results available on the cursor, and false otherwise.

Hatalar/İstisnalar

Örnekler

Örnek 1 MongoDB\Driver\Cursor::isDead() example

<?php

$manager
= new MongoDB\Driver\Manager("mongodb://localhost:27017");
$query = new MongoDB\Driver\Query([]);

$bulk = new MongoDB\Driver\BulkWrite;
$bulk->insert(['x' => 1]);
$bulk->insert(['x' => 2]);
$bulk->insert(['x' => 3]);
$manager->executeBulkWrite('db.collection', $bulk);

$cursor = $manager->executeQuery('db.collection', $query);

$iterator = new IteratorIterator($cursor);

$iterator->rewind();
var_dump($cursor->isDead());

$iterator->next();
var_dump($cursor->isDead());

$iterator->next();
var_dump($cursor->isDead());

$iterator->next();
var_dump($cursor->isDead());

?>

Yukarıdaki örneğin çıktısı:

bool(false)
bool(false)
bool(false)
bool(true)

Ayrıca Bakınız