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.
1 parent 98edf8b commit c9cbea0Copy full SHA for c9cbea0
test/model.test.js
@@ -4157,7 +4157,8 @@ describe('Model', function() {
4157
filter: { _id: r1._id },
4158
update: {
4159
$set: {
4160
- 'testArray.$[element].field1': field1update
+ 'testArray.$[element].field1': field1update,
4161
+ 'testArray.$[element].nonexistentProp': field1update
4162
}
4163
},
4164
arrayFilters: [
@@ -4168,8 +4169,9 @@ describe('Model', function() {
4168
4169
]
4170
4171
}]);
- const r2 = await TestModel.findById(r1._id);
4172
+ const r2 = await TestModel.findById(r1._id).lean();
4173
assert.equal(r2.testArray[0].field1, field1update);
4174
+ assert.strictEqual(r2.testArray[0].nonexistentProp, undefined);
4175
});
4176
4177
it('with child timestamps and array filters (gh-7032)', async function() {
0 commit comments