#Model.deleteMany() no longer accepts a callback

10 messages · Page 1 of 1 (latest)

silent magnet

levelSchema.deleteMany({ Guild: guildId }, async (err, data) => {
Model.deleteMany() no longer accepts a callback
how i fix this?

stable ivyBOT
  • Consider reading #how-to-get-help to improve your question!
  • Explain what exactly your issue is.
  • Post the full error stack trace, not just the top part!
  • Show your code!
  • Issue solved? Press the button!
jolly heron

refactor your code to use async/await, or use ```ts
deleteMany(...).then((data) => {
// process data
}).catch((err) => {
// handle error
})

whole charm
north stratus

What kinda comment is that. That’s no reason to just not help someone at all

odd patrol

If it’s a single guild, just findOneAndDelete will work fine

whole charm
north stratus

Then dont bother contributing.

whole charm
shrewd bridge