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
When mongoose try to populate a document I have this error
TypeError: Cannot read properties of undefined (reading 'options')
at SchemaUUID._castRef (/Users/username/Projects/applications/mybackend/node_modules/mongoose/lib/schematype.js:1531:19)
at SchemaUUID.cast (/Users/username/Projects/applications/mybackend/node_modules/mongoose/lib/schema/uuid.js:255:17)
at _init (/Users/username/Projects/applications/mybackend/node_modules/mongoose/lib/document.js:781:35)
at init (/Users/username/Projects/applications/mybackend/node_modules/mongoose/lib/document.js:735:5)
at EmbeddedDocument.Document.$__init (/Users/username/Projects/applications/mybackend/node_modules/mongoose/lib/document.js:694:3)
at EmbeddedDocument.syncWrapper [as $__init] (/Users/username/Projects/applications/mybackend/node_modules/kareem/index.js:331:25)
at EmbeddedDocument.Document.init (/Users/username/Projects/applications/mybackend/node_modules/mongoose/lib/document.js:638:8)
at EmbeddedDocument.Document.$init (/Users/username/Projects/applications/mybackend/node_modules/mongoose/lib/document.js:654:42)
at DocumentArrayPath.cast (/Users/username/Projects/applications/mybackend/node_modules/mongoose/lib/schema/documentarray.js:495:30)
at _init (/Users/username/Projects/applications/mybackend/node_modules/mongoose/lib/document.js:781:35)
It du to cast function in uuid.js, it doesn't have binary or embeded case.
vkarpov15
added
confirmed-bug
We've confirmed this is a bug in Mongoose and will fix it.
and removed
help
This issue can likely be resolved in GitHub issues. No bug fixes, features, or docs necessary
help wanted
labels
Apr 23, 2023
Prerequisites
Mongoose version
7.0.3
Node.js version
v16.13.1
MongoDB version
4.2
Operating system
macOS
Operating system version (i.e. 20.04, 11.3, 10)
No response
Issue
When mongoose try to populate a document I have this error
It du to cast function in uuid.js, it doesn't have binary or embeded case.
On stackoverflow some people talk about override it as
This is my user schema
This is how I called the populate on user schema
Language and collect references are in errors.
Is there a way to improve that ?
The text was updated successfully, but these errors were encountered: