Skip to content

Commit

Permalink
feat(schema): set $implicitlyCreated on schema if created by interpre…
Browse files Browse the repository at this point in the history
…tAsType

Fix #4443
  • Loading branch information
vkarpov15 committed Oct 4, 2016
1 parent e6d2cc2 commit 349b697
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -616,6 +616,7 @@ Schema.interpretAsType = function(path, obj, options) {
childSchemaOptions.typeKey = options.typeKey;
}
var childSchema = new Schema(cast, childSchemaOptions);
childSchema.$implicitlyCreated = true;
return new MongooseTypes.DocumentArray(path, childSchema, obj);
} else {
// Special case: empty object becomes mixed
Expand Down

0 comments on commit 349b697

Please sign in to comment.