You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Do you want to request a feature or report a bug?
bug
What is the current behavior?
When populating a model with a refPath that hasn't been registered, mongoose gives a schema error even if the reference ID contains no values. This wasn't giving an error up until mongoose@5.8.4
If the current behavior is a bug, please provide the steps to reproduce.
The script below works up to mongoose 5.8.3 and fails for any versions beyond.
MissingSchemaError: Schema hasn't been registered for model "third".
Use mongoose.model(name, schema)
at NativeConnection.Connection.model (...\node_modules\mongoose\lib\connection.js:1192:11)
at getModelsMapForPopulate (...\node_modules\mongoose\lib\helpers\populate\getModelsMapForPopulate.js:283:59)
at populate (...\node_modules\mongoose\lib\model.js:4309:21)
What is the expected behavior?
No errors when populating empty references.
What are the versions of Node.js, Mongoose and MongoDB you are using? Note that "latest" is not a version.
Node: 12.18.3
Mongoose: 5.10.0
MongoDB: 4.2.7
The text was updated successfully, but these errors were encountered:
vkarpov15
added
confirmed-bug
We've confirmed this is a bug in Mongoose and will fix it.
and removed
has repro script
There is a repro script, the Mongoose devs need to confirm that it reproduces the issue
labels
Aug 26, 2020
Do you want to request a feature or report a bug?
bug
What is the current behavior?
When populating a model with a refPath that hasn't been registered, mongoose gives a schema error even if the reference ID contains no values. This wasn't giving an error up until mongoose@5.8.4
If the current behavior is a bug, please provide the steps to reproduce.
The script below works up to mongoose 5.8.3 and fails for any versions beyond.
The following error is produced:
What is the expected behavior?
No errors when populating empty references.
What are the versions of Node.js, Mongoose and MongoDB you are using? Note that "latest" is not a version.
Node: 12.18.3
Mongoose: 5.10.0
MongoDB: 4.2.7
The text was updated successfully, but these errors were encountered: