path discriminator with nested 'new Schema' will cause 'MissingSchemaError' when create data #8527
Labels
confirmed-bug
We've confirmed this is a bug in Mongoose and will fix it.
Milestone
Do you want to request a feature or report a bug?
Bug (not sure)
What is the current behavior?
throw
"Schema hasn't been registered for model "NestedData". Use mongoose.model(name, schema)"
when create entryIf the current behavior is a bug, please provide the steps to reproduce.
What is the expected behavior?
create without error no matter the nested schema is a plain Object or an instance of
Schema
What are the versions of Node.js, Mongoose and MongoDB you are using? Note that "latest" is not a version.
node: v10.17.0
mongoDB: 4.2.1
mongoose: 5.8.9
The text was updated successfully, but these errors were encountered: