Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

mongoclient.getconnections(3) [php man page]

MONGOCLIENT.GETCONNECTIONS(3)						 1					     MONGOCLIENT.GETCONNECTIONS(3)

MongoClient::getConnections - Return info about all open connections

SYNOPSIS
publicstatic array MongoClient::getConnections (void ) DESCRIPTION
Returns an array of all open connections, and information about each of the servers PARAMETERS
This function has no parameters. RETURN VALUES
An array of open connections. EXAMPLES
Example #1 MongoClient::getConnections example <?php $m = new MongoClient; var_dump($m->getConnections()); ?> The above example will output something similar to: array(1) { [0]=> array(3) { ["hash"]=> string(26) "localhost:27017;-;X;56052" ["server"]=> array(3) { ["host"]=> string(10) "localhost" ["port"]=> int(27017) ["pid"]=> int(56052) } ["connection"]=> array(8) { ["last_ping"]=> int(1354076401) ["last_ismaster"]=> int(0) ["ping_ms"]=> int(0) ["connection_type"]=> int(1) ["connection_type_desc"]=> string(10) "STANDALONE" ["max_bson_size"]=> int(16777216) ["tag_count"]=> int(0) ["tags"]=> array(0) { } } } } PHP Documentation Group MONGOCLIENT.GETCONNECTIONS(3)

Check Out this Related Man Page

MONGOCOLLECTION.GETREADPREFERENCE(3)					 1				      MONGOCOLLECTION.GETREADPREFERENCE(3)

MongoCollection::getReadPreference - Get the read preference for this collection

SYNOPSIS
public array MongoCollection::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. CHANGELOG
+--------+---------------------------------------------------+ |Version | | | | | | | Description | | | | +--------+---------------------------------------------------+ | 1.3.3 | | | | | | | The return value has changed to be consistent | | | with MongoCollection::setReadPreference. The type | | | value was changed from a number to a string, | | | type_string was removed, and tagsets now | | | expresses tags as key/value pairs instead of | | | colon-delimited strings. | | | | +--------+---------------------------------------------------+ EXAMPLES
Example #1 MongoCollection::getReadPreference return value example <?php $m = new MongoClient(); $c = $m->test->users; $c->setReadPreference(MongoClient::RP_SECONDARY, array( array('dc' => 'east', 'use' => 'reporting'), array('dc' => 'west'), array(), )); var_dump($c->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., MongoCollection.setReadPreference(3). PHP Documentation Group MONGOCOLLECTION.GETREADPREFERENCE(3)
Man Page