php - How to list all databases using yii2 in mongodb? -


i need list of databases on current server. using yii2 framework. how list of databases? yii2 v2.1 has functions list of databases, want use yii2 v2.0.

$all = yii::$app->mongodb->createcommand()->listdatabases(); 

where mongodb configured mongo instance. response may like:

$all:array =    0: array =      name: string = local     sizeondisk: double = 83886080     empty: bool = false   1: array =      name: string = testdd     sizeondisk: double = 19268632576     empty: bool = false   2: array =      name: string = admin     sizeondisk: double = 1     empty: bool = true 

Comments

Popular posts from this blog

sql - invalid in the select list because it is not contained in either an aggregate function -

Angularjs unit testing - ng-disabled not working when adding text to textarea -

How to start daemon on android by adb -