Skip to content

Commit 9f542d1

Browse files
authored
fix(query): correct this scope of setters in update query
Fix #7876 re: #4185 `this` inside setters will be a Query when executing an update query.
1 parent 853d705 commit 9f542d1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/helpers/query/castUpdate.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ function castUpdateVal(schema, val, op, $conditional, context, path) {
386386
++arrayDepth;
387387
}
388388

389-
let tmp = schema.applySetters(Array.isArray(val) ? val : [val]);
389+
let tmp = schema.applySetters(Array.isArray(val) ? val : [val], context);
390390

391391
for (let i = 0; i < additionalNesting; ++i) {
392392
tmp = tmp[0];

0 commit comments

Comments
 (0)