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

search for in the

MongoClient::getHosts> <MongoClient::__get
[edit] Last updated: Fri, 24 May 2013

view this page in

MongoClient::getConnections

(PECL mongo >=1.3.0)

MongoClient::getConnectionsReturn info about all open connections

Description

public static void MongoClient::getConnections ( void )

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) {
      }
    }
  }
}


add a note add a note User Contributed Notes MongoClient::getConnections - [0 notes]
There are no user contributed notes for this page.

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