Skip to content

Commit ab1998f

Browse files
committed
PHPC-157: Renamed getResponseDocument() to toArray()
1 parent 60cdf72 commit ab1998f

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

docs/commands.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ $manager = new MongoDB\Driver\Manager("mongodb://localhost:27017");
1111

1212
$listdatabases = new MongoDB\Driver\Command(array("listDatabases" => 1));
1313
$retval = $manager->executeCommand("admin", $listdatabases);
14-
$databases = $retval->getResponseDocument();
14+
$databases = $retval->toArray();
1515

1616
foreach($databases["databases"] as $database) {
1717
echo $database->name, "\n";
1818

1919
$listcollections = new MongoDB\Driver\Command(array("listCollections" => 1));
2020
$retval = $manager->executeCommand($database->name, $listcollections);
21-
$collections = $retval->getResponseDocument();
21+
$collections = $retval->toArray();
2222
foreach($collections["collections"] as $collection) {
2323
echo "\t- ", $collection->name, "\n";
2424
}
@@ -52,7 +52,7 @@ $createuser = new MongoDB\Driver\Command($command);
5252

5353
try {
5454
$result = $manager->executeCommand("admin", $createuser);
55-
$response = $result->getResponseDocument();
55+
$response = $result->toArray();
5656
if ($reponse["ok"]) {
5757
echo "User created\n";
5858
}
@@ -93,7 +93,7 @@ $manager = new MongoDB\Driver\Manager("mongodb://localhost:27017");
9393
$query = array("citizen" => "Iceland");
9494
$count = new MongoDB\Driver\Command(array("count" => "collection", "query" => $query));
9595
$retval = $manager->executeCommand("db", $count, $rp);
96-
$response = $retval->getResponseDocument();
96+
$response = $retval->toArray();
9797
if ($response["ok"]) {
9898
printf("db.collection has %d documents matching: %s\n",
9999
$response["n"],

tests/standalone/manager-executeCommand-001.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ var_dump($result instanceof MongoDB\Driver\CommandResult);
1616
var_dump($result);
1717

1818
echo "Dumping response document:\n";
19-
var_dump($result->getResponseDocument());
19+
var_dump($result->toArray());
2020

2121
echo "Dumping iterated result:\n";
2222
var_dump(iterator_to_array($result));

tests/standalone/server-executeCommand-001.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ $result = $server->executeCommand(DATABASE_NAME, $command);
1414

1515
var_dump($result instanceof MongoDB\Driver\CommandResult);
1616

17-
$responseDocument = $result->getResponseDocument();
17+
$responseDocument = $result->toArray();
1818

1919
var_dump( ! empty($responseDocument['ok']));
2020
var_dump($server == $result->getServer());

0 commit comments

Comments
 (0)