MongoCursor::setFlag

(Ingen versionsoplysninger tilgængelige, findes måske kun i SVN)

MongoCursor::setFlagSets arbitrary flags in case there is no method available the specific flag

Beskrivelse

public MongoCursor MongoCursor::setFlag ( bool $flag [, bool $set = true ] )

The MongoCursor class has several methods for setting flags on the query object. This method is available in case the MongoDB wire protocol has acquired a new flag, and the driver has not been updated with a method for this new flag. In all other cases, the method should be used. See the "See also" section for available methods.

Parametre

flag

Which flag to set. You can not set flag 3 (OPLOG REPLAY) or flag 6 (EXHAUST) as the driver does not know how to handle them. You will get a warning if you try to use those. For available flags, please refer to the wire protocol » documentation.

set

Whether the flag should be set (TRUE) or unset (FALSE).

Returnerings Værdier

Returns this cursor.

Fejl/Undtagelser

Shows a warning when an unsupport flag is attempted to be set.

Eksempler

Eksempel #1 MongoCursor::setFlag() example

<?php
$m 
= new Mongo'mongodb://localhost:13000', array( 'replSet' => 'seta' ) );
$c $m->local->selectCollection'oplog.rs' );
$cursor $c->find( array( 'ns' => 'demo.article''op' => 'i' ) );
$cursor->setFlag1true ); // sets the tailable flag
$cursor->setFlag5true ); // sets the await data flag
?>

Se også

MongoDB core docs on » wire protocol query flags.

add a note add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top