We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents d24f266 + d38361a commit cda22a9Copy full SHA for cda22a9
src/MockCollection.php
@@ -216,19 +216,19 @@ private function updateCore(&$doc, $update)
216
}
217
218
foreach ($update['$unset'] ?? [] as $k => $v) {
219
- if (array_key_exists($k, $doc)) {
+ if (isset($doc[$k])) {
220
unset($doc[$k]);
221
222
223
224
foreach ($update['$inc'] ?? [] as $k => $v) {
225
- if (array_key_exists($k, $doc) && is_integer($v) && is_integer($doc[$k])) {
+ if (isset($doc[$k]) && is_integer($v) && is_integer($doc[$k])) {
226
$doc[$k] += $v;
227
228
229
230
foreach ($update['$push'] ?? [] as $k => $v) {
231
- if (array_key_exists($k, $doc) && is_array($doc[$k])) {
+ if (isset($doc[$k]) && is_array($doc[$k])) {
232
$doc[$k][] = $v;
233
234
0 commit comments