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
@vkarpov15: Thank you for your last comment, it provided the missing link. I was able to migrate to Mongoose 6 now.
To recap the missing parts in documentation:
While for the user document (interface) in Mongoose 5 string types as MongoIds worked, in Mongoose 6 you either have to use Types.ObjectId (if you don't want to populate) or PopulatedDoc<OtherUserDocument, Types.ObjectId> as type for your Ids.
In the Schema Definition, both variants have to be set as Schema.Types.ObjectId.
The difference between Schema.Types.ObjectId and Types.ObjectId should be explained somewhere, since it is not intuitive.
vkarpov15
added
typescript
Types or Types-test related issue / Pull Request
and removed
docs
This issue is due to a mistake or omission in the mongoosejs.com documentation
labels
Nov 30, 2021
#10617 (comment)
The text was updated successfully, but these errors were encountered: