Skip to content

Commit 619c27d

Browse files
committed
PHPLIB-92: Update methods should use "multi" option
1 parent 87cd989 commit 619c27d

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
@@ -1038,7 +1038,7 @@ public function replaceOne(array $filter, array $update, array $options = array(
10381038
if (isset($firstKey[0]) && $firstKey[0] == '$') {
10391039
throw new InvalidArgumentException("First key in \$update must NOT be a \$operator");
10401040
}
1041-
$wr = $this->_update($filter, $update, $options);
1041+
$wr = $this->_update($filter, $update, $options + array("multi" => false));
10421042

10431043
return new UpdateResult($wr);
10441044
}
@@ -1057,7 +1057,7 @@ public function replaceOne(array $filter, array $update, array $options = array(
10571057
*/
10581058
public function updateMany(array $filter, $update, array $options = array())
10591059
{
1060-
$wr = $this->_update($filter, $update, $options + array("limit" => 0));
1060+
$wr = $this->_update($filter, $update, $options + array("multi" => true));
10611061

10621062
return new UpdateResult($wr);
10631063
}
@@ -1080,7 +1080,7 @@ public function updateOne(array $filter, array $update, array $options = array()
10801080
if (!isset($firstKey[0]) || $firstKey[0] != '$') {
10811081
throw new InvalidArgumentException("First key in \$update must be a \$operator");
10821082
}
1083-
$wr = $this->_update($filter, $update, $options);
1083+
$wr = $this->_update($filter, $update, $options + array("multi" => false));
10841084

10851085
return new UpdateResult($wr);
10861086
}

0 commit comments

Comments
 (0)