@@ -11,14 +11,14 @@ $manager = new MongoDB\Driver\Manager("mongodb://localhost:27017");
11
11
12
12
$listdatabases = new MongoDB\Driver\Command(array("listDatabases" => 1));
13
13
$retval = $manager->executeCommand("admin", $listdatabases);
14
- $databases = $retval->getResponseDocument ();
14
+ $databases = $retval->toArray ();
15
15
16
16
foreach($databases["databases"] as $database) {
17
17
echo $database->name, "\n";
18
18
19
19
$listcollections = new MongoDB\Driver\Command(array("listCollections" => 1));
20
20
$retval = $manager->executeCommand($database->name, $listcollections);
21
- $collections = $retval->getResponseDocument ();
21
+ $collections = $retval->toArray ();
22
22
foreach($collections["collections"] as $collection) {
23
23
echo "\t- ", $collection->name, "\n";
24
24
}
@@ -52,7 +52,7 @@ $createuser = new MongoDB\Driver\Command($command);
52
52
53
53
try {
54
54
$result = $manager->executeCommand("admin", $createuser);
55
- $response = $result->getResponseDocument ();
55
+ $response = $result->toArray ();
56
56
if ($reponse["ok"]) {
57
57
echo "User created\n";
58
58
}
@@ -93,7 +93,7 @@ $manager = new MongoDB\Driver\Manager("mongodb://localhost:27017");
93
93
$query = array("citizen" => "Iceland");
94
94
$count = new MongoDB\Driver\Command(array("count" => "collection", "query" => $query));
95
95
$retval = $manager->executeCommand("db", $count, $rp);
96
- $response = $retval->getResponseDocument ();
96
+ $response = $retval->toArray ();
97
97
if ($response["ok"]) {
98
98
printf("db.collection has %d documents matching: %s\n",
99
99
$response["n"],
0 commit comments