From 1b19af2ed50a9c25d1cd1f4c3112a18b1059402b Mon Sep 17 00:00:00 2001 From: Valeri Karpov Date: Mon, 7 Sep 2020 16:32:47 -0400 Subject: [PATCH] test(schema): repro #9390 --- test/schema.test.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/schema.test.js b/test/schema.test.js index 1664f99d0a9..912340efd56 100644 --- a/test/schema.test.js +++ b/test/schema.test.js @@ -739,11 +739,17 @@ describe('schema', function() { }, { _id: true }); assert.ok(schema.path('_id') instanceof Schema.ObjectId); + schema.set('_id', false); + assert.ok(schema.path('_id') == null); + schema = new Schema({ name: String }, { _id: false }); assert.equal(schema.path('_id'), undefined); + schema.set('_id', true); + assert.ok(schema.path('_id') instanceof Schema.ObjectId); + // old options schema = new Schema({ name: String