MongoDb : Where is deleteMany operation?

We are using MongoDb. I can find deleteOne operation, but where is the deleteMany ?

Here is a screenshot :

Hey @_andrey! Good catch - we don’t currently support the .deleteMany method, and we definitely should. For now, you can workaround by creating a Run JS Code query, iterating through the set that you want to update, and triggering a .deleteOne query for each with the associated payload. If that would work, I can provide more detail - I wrote out the basics for how to do this here (for Firebase).

Thank you @Justin ! Sometimes we need to delete like 700 documents in our mongo. I don’t think making 700 requests to the database is a good idea.

So far we will probably create a special endpoint on our server API to delete many records at once.

I hope the .deleteMany method will be supported soon by Retool !

2 Likes

We should definitely add it - will update the thread when we’re able to prioritize it!

1 Like