const muteFind = await db.find({
user: user.user.id,
guild: message.guild.id,
reason:
"Impersonating members/bots by using their same username or profile picture. You will remain muted until you change your username and profile picture. After you have done this, DM any moderator to be unmuted.",
automod: false,
});
if (muteFind) await muteFind.deleteOne();```
the error is in the title
#TypeError: muteFind.deleteOne is not a function
4 messages · Page 1 of 1 (latest)
- 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!
✅Marked as resolved by OP
.find() generally returns an array of all documents matching the query
You should use .findOne() if you only want one document
Also you could just pass the query into a db.deleteOne() call (assuming db is a model) instead of finding a document first