Skip to content

Commit e5a2d33

Browse files
committed
Alias id to _id in subdocuments
1 parent 83ca5a8 commit e5a2d33

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/Query/Builder.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1060,12 +1060,7 @@ protected function performUpdate(array $update, array $options = [])
10601060
$options['multiple'] = true;
10611061
}
10621062

1063-
// Since "id" is an alias for "_id", we prevent updating it
1064-
foreach ($update as $operator => $fields) {
1065-
if (array_key_exists('id', $fields)) {
1066-
throw new InvalidArgumentException('Cannot update "id" field.');
1067-
}
1068-
}
1063+
$update = $this->aliasIdForQuery($update);
10691064

10701065
$options = $this->inheritConnectionOptions($options);
10711066

0 commit comments

Comments
 (0)