Skip to content

Commit

Permalink
added failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
IslandRhythms committed Jan 21, 2021
1 parent 07d663f commit 25ba5f1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
1 change: 0 additions & 1 deletion lib/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,6 @@ reserved.isNew =
reserved.populated =
reserved.remove =
reserved.save =
reserved.schema =
reserved.toObject =
reserved.validate = 1;

Expand Down
12 changes: 12 additions & 0 deletions test/document.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9850,4 +9850,16 @@ describe('document', function() {
assert.ok(!_doc);
});
});
it('handles paths named `schema` gh-8798', function() {
const schema = new Schema({
schema: String,
name: String
});
const Test = db.model('Test', schema);
return co(function*() {
const doc = yield Test.create({ schema: 'foo' }, { name: 'frank' });
yield doc.save();
assert.ok(doc);
});
});
});

0 comments on commit 25ba5f1

Please sign in to comment.