downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

MongoCursor::sort> <MongoCursor::skip
[edit] Last updated: Fri, 18 Sep 2009

view this page in

MongoCursor::slaveOkay

(PECL mongo >=0.9.4)

MongoCursor::slaveOkaySets whether this query can be done on a slave

Описание

public MongoCursor MongoCursor::slaveOkay ([ boolean $okay = true ] )

This method will override the static class variable slaveOkay.

Параметри

okay

If it is okay to query the slave.

Връщани стойности

Returns this cursor.

Грешки/Изключения

Throws MongoCursorException if this cursor has started iterating.

Примери

Example #1 MongoCursor::slaveOkay() example

<?php

MongoCursor
::$slaveOkay false;

// cannot query slave
$cursor $collection->find();

// can query slave
$cursor $collection->find()->slaveOkay();

MongoCursor::$slaveOkay true;

// can query slave
$cursor $collection->find();

// cannot query slave
$cursor $collection->find()->slaveOkay(false);

?>


add a note add a note User Contributed Notes MongoCursor::slaveOkay
There are no user contributed notes for this page.

 
show source | credits | stats | sitemap | contact | advertising | mirror sites