Skip to content

how to stop mongoose from writing schema defaults when using find? #12385

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

You must be logged in to vote

const docs = await UserModel.find({ role: 'admin' }).setOptions({ defaults: false }) in Mongoose >= 5.12.10, see #7287

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@samislam
Comment options

@vkarpov15
Comment options

Answer selected by samislam
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