Skip to content

Commit

Permalink
test(schema): repro #7524
Browse files Browse the repository at this point in the history
  • Loading branch information
vkarpov15 committed Feb 24, 2019
1 parent 98faac0 commit 6b5184b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/schema.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1969,11 +1969,15 @@ describe('schema', function() {
return Promise.resolve();
});

it('supports _id: false in paths definition (gh-7480)', function() {
it('supports _id: false in paths definition (gh-7480) (gh-7524)', function() {
const schema = new Schema({ _id: false, name: String });
assert.ok(schema.path('_id') == null);
assert.equal(schema.options._id, false);

const otherSchema = new Schema({ name: String, nested: { _id: false, name: String } });
assert.ok(otherSchema.path('_id'));
assert.equal(otherSchema.options._id, true);

return Promise.resolve();
});
});

0 comments on commit 6b5184b

Please sign in to comment.