Skip to content

Commit d24195c

Browse files
committed
Return findAndModify result document as an array
1 parent 30444c7 commit d24195c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Collection.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ public function findOneAndDelete(array $filter, array $options = array())
497497

498498
$doc = current($this->_runCommand($this->dbname, $cmd)->toArray());
499499
if ($doc["ok"]) {
500-
return $doc["value"];
500+
return (array) $doc["value"];
501501
}
502502

503503
throw $this->_generateCommandException($doc);
@@ -534,7 +534,7 @@ public function findOneAndReplace(array $filter, array $replacement, array $opti
534534

535535
$doc = current($this->_runCommand($this->dbname, $cmd)->toArray());
536536
if ($doc["ok"]) {
537-
return $doc["value"];
537+
return (array) $doc["value"];
538538
}
539539

540540
throw $this->_generateCommandException($doc);
@@ -572,7 +572,7 @@ public function findOneAndUpdate(array $filter, array $update, array $options =
572572

573573
$doc = current($this->_runCommand($this->dbname, $cmd)->toArray());
574574
if ($doc["ok"]) {
575-
return $doc["value"];
575+
return (array) $doc["value"];
576576
}
577577

578578
throw $this->_generateCommandException($doc);

0 commit comments

Comments
 (0)