Skip to content

mongoose.connection.model return instanceof Model #12179

Answered by vkarpov15
hasezoey asked this question in Q&A
Discussion options

You must be logged in to vote

mongoose.connection.model returns a "class" that extends from mongoose.Model, not an instance of mongoose.Model. console.log(Object.getPrototypeOf(model) === mongoose.Model); // true

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@hasezoey
Comment options

hasezoey Aug 4, 2022
Collaborator Author

@vkarpov15
Comment options

@hasezoey
Comment options

hasezoey Aug 9, 2022
Collaborator Author

Answer selected by hasezoey
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants