I need a list of databases on the current server. I am using yii2 framework. How do I get the list of databases? yii2 v2.1 has functions to get this list of databases, but I want use yii2 v2.0.
$all = Yii::$app->mongodb->createCommand()->listDatabases();
where mongodb is configured mongo instance. Response may look 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