diff --git a/lib/schema.js b/lib/schema.js index cc721b074ee..b02ec83109f 100644 --- a/lib/schema.js +++ b/lib/schema.js @@ -938,7 +938,8 @@ Schema.prototype.interpretAsType = function(path, obj, options) { } if (this._userProvidedOptions.hasOwnProperty('_id')) { childSchemaOptions._id = this._userProvidedOptions._id; - } else if (Schema.Types.DocumentArray.defaultOptions._id != null) { + } else if (Schema.Types.DocumentArray.defaultOptions && + Schema.Types.DocumentArray.defaultOptions._id != null) { childSchemaOptions._id = Schema.Types.DocumentArray.defaultOptions._id; }