I'm try this but this delete only one user i need to delete all users on the database
JailSchema.findOneAndDelete(
{
guildId: interaction.guild.id,
},
(err, res) => {
if (err) console.log(err);
console.log("Done");
}
);
CodePudding user response:
You are using a mongoose function literally called findOneAndDelete
, instead use the deleteMany
function and give it the same identifier, should work the same but it won't limit itself to 1.