mongocursor.getreadpreference(3) php man page | unix.com

Man Page: mongocursor.getreadpreference

Operating Environment: php

Section: 3

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)
Related Man Pages
mongoclient(3) - php
mongo(3) - php
mongocollection.getreadpreference(3) - php
mongocommandcursor.createfromdocument(3) - php
mongocursor.info(3) - php
Similar Topics in the Unix Linux Community
function return array
how to read delimited text into array
How do I test the first char of each line in an array
How to pass and read an array in ksh shell script function.?