MongoClient::listDBs PHP Метод

listDBs() публичный Метод

Lists all of the databases available.
public listDBs ( ) : array
Результат array - Returns an associative array containing three fields. The first field is databases, which in turn contains an array. Each element of the array is an associative array corresponding to a database, giving th database's name, size, and if it's empty. The other two fields are totalSize (in bytes) and ok, which is 1 if this method ran successfully.
    public function listDBs()
    {
        $cmd = ['listDatabases' => 1];
        $result = $this->selectDB(self::DEFAULT_DATABASE)->command($cmd);
        return $result;
    }

Usage Example

Пример #1
0
 public function listDatabases()
 {
     $this->initialize();
     return $this->mongo->listDBs();
 }
All Usage Examples Of MongoClient::listDBs