Skip to content

Commit

Permalink
test(document): repro #10449
Browse files Browse the repository at this point in the history
  • Loading branch information
vkarpov15 committed Jul 28, 2021
1 parent a0d8e76 commit 7dd2aaf
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/document.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10469,4 +10469,20 @@ describe('document', function() {
}
});

it('does not pull non-schema paths from parent documents into nested paths (gh-10449)', function() {
const schema = new Schema({
name: String,
nested: {
data: String
}
});
const Test = db.model('Test', schema);

return co(function*() {
const doc = new Test({});
doc.otherProp = 'test';

assert.ok(!doc.nested.otherProp);
});
});
});

0 comments on commit 7dd2aaf

Please sign in to comment.