note 95047 added to mongo.selectdb
| From: | mike at blueroot dot co dot uk | Date: | Thu, 10 Dec 2009 18:38:13 +0000 |
| Subject: | note 95047 added to mongo.selectdb | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-163821@lists.php.net to get a copy of this message | ||
There is no listDBs function and the console command 'show dbs' cannot be used with the
PHP bindings, this function gives a list of databases with their size on disk.
function listDBs(){
$mongo = new Mongo();
$db = $mongo->selectDB('test');
$dbs_ret = $db->execute('new Mongo().getDBs();');
if (!$dbs_ret['ok']){
return false;
}
return $dbs_ret['databases'];
}
----
Server IP: 92.48.74.199
Probable Submitter: 91.111.23.128
----
Manual Page -- http://www.php.net/manual/en/mongo.selectdb.php
Edit -- https://master.php.net/note/edit/95047
Del: integrated -- https://master.php.net/note/delete/95047/integrated
Del: useless -- https://master.php.net/note/delete/95047/useless
Del: bad code -- https://master.php.net/note/delete/95047/bad+code
Del: spam -- https://master.php.net/note/delete/95047/spam
Del: non-english -- https://master.php.net/note/delete/95047/non-english
Del: in docs -- https://master.php.net/note/delete/95047/in+docs
Del: other reasons-- https://master.php.net/note/delete/95047
Reject -- https://master.php.net/note/reject/95047
Search -- https://master.php.net/manage/user-notes.php