Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

mongocursor.getreadpreference(3) [php man page]

MONGOCURSOR.GETREADPREFERENCE(3)					 1					  MONGOCURSOR.GETREADPREFERENCE(3)

MongoCursor::getReadPreference - Get the read preference for this query

SYNOPSIS
public array MongoCursor::getReadPreference (void ) DESCRIPTION
PARAMETERS
This function has no parameters. RETURN VALUES
This function returns an array describing the read preference. The array contains the values type for the string read preference mode (cor- responding to the MongoClient constants), and tagsets containing a list of all tag set criteria. If no tag sets were specified, tagsets will not be present in the array. EXAMPLES
Example #1 MongoCursor::getReadPreference return value example <?php $m = new MongoClient(); $cursor = $m->test->users->find(); $cursor->setReadPreference(MongoClient::RP_SECONDARY, array( array('dc' => 'east', 'use' => 'reporting'), array('dc' => 'west'), array(), )); var_dump($cursor->getReadPreference()); ?> The above example will output: array(2) { ["type"]=> string(9) "secondary" ["tagsets"]=> array(3) { [0]=> array(2) { ["dc"]=> string(4) "east" ["use"]=> string(9) "reporting" } [1]=> array(1) { ["dc"]=> string(7) "west" } [2]=> array(0) { } } } SEE ALSO The read preferences documentation., MongoCursor.setReadPreference(3), MongoCursorInterface.getReadPreference(3). PHP Documentation Group MONGOCURSOR.GETREADPREFERENCE(3)

Check Out this Related Man Page

MONGO(3)								 1								  MONGO(3)

The Mongo class [deprecated]

INTRODUCTION
A connection between PHP and MongoDB. This class extends MongoClient and provides access to several deprecated methods. For backwards compatibility, it also defaults the "w" option of its constructor argument to 0, which does not require write operations to be acknowledged by the server. See MongoClient.__construct(3) for more information. Warning This class has been DEPRECATED as of version 1.3.0. Relying on this feature is highly discouraged. Please use MongoClient instead. CLASS SYNOPSIS
Mongo Mongoextends MongoClient Methods o protected bool Mongo::connectUtil (void ) o publicstatic int Mongo::getPoolSize (void ) o public string Mongo::getSlave (void ) o public bool Mongo::getSlaveOkay (void ) o public array Mongo::poolDebug (void ) o publicstatic bool Mongo::setPoolSize (int $size) o public bool Mongo::setSlaveOkay ([bool $ok = true]) o public string Mongo::switchSlave (void ) Inherited methods o public bool MongoClient::close ([boolean|string $connection]) o public bool MongoClient::connect (void ) o public array MongoClient::dropDB (mixed $db) o public MongoDB MongoClient::__get (string $dbname) o publicstatic array MongoClient::getConnections (void ) o public array MongoClient::getHosts (void ) o public array MongoClient::getReadPreference (void ) o public array MongoClient::getWriteConcern (void ) o public bool MongoClient::killCursor (string $server_hash, int|MongoInt64 $id) o public array MongoClient::listDBs (void ) o public MongoCollection MongoClient::selectCollection (string $db, string $collection) o public MongoDB MongoClient::selectDB (string $name) o public bool MongoClient::setReadPreference (string $read_preference, [array $tags]) o public bool MongoClient::setWriteConcern (mixed $w, [int $wtimeout]) o public string MongoClient::__toString (void ) PHP Documentation Group MONGO(3)
Man Page