Skip to content

How can I use .find() with await ? #10930

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

You must be logged in to vote

You're using find() incorrectly. If you call find() with a function, Mongoose assumes the function is a callback to execute when the query completes, not a function that filters documents. You should do await Reactor.find({ channelID: oldchannel.id })

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Redemption007
Comment options

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