MongoClient::dropDB
MongoClient::getConnections
MongoClient
PHP Manual

# MongoClient::__get

(PECL mongoclient >=1.0.2)

MongoClient::__get — Gets a database

### Descrição

public MongoDB MongoClient::__get ( string `$dbname` )

This is the cleanest way of getting a database. If the database name has any special characters, MongoClient::selectDB() will need to be used; however, this should be sufficient for most cases.

`<?php
$mongo = new MongoClient();
// the following two lines are equivalent
$db = $mongo->selectDB("foo");
$db = $mongo->foo;
?>`

### Parâmetros

`dbname`

  The database name.

### Valor Retornado

Returns a new db object.

### Erros

Throws a generic exception if the database name is invalid.

MongoClient::dropDB
MongoClient::getConnections
MongoClient
PHP Manual