Any hot tips for how to delete a set of
Any hot tips for how to delete a set of documents whose count is greater than 4096 (in prod environment)? Manually deleting thousands of documents is an unattractive solution (see screenshot) π
I imagine I could write a mutation which would do so, deploy it, and run it, but is there an easier way? (I'm aware this may not be something you'd like to make easier)

6 Replies
Hey RJ, the best way right now would likely be to write a mutation function that loops over your documents and calls
db.delete
on them. You may need to do this over multiple mutation calls if the table is large so the mutation doesn't timeout
We definitely don't want it to be too easy to wipe out a table (and if you try to do so in prod, you'll get a warning), but it should still be possible from the dashboard. I'll file this as feedback!Great, thank you!
Also the suggestion in that error message looks so silly in context, thanks for flagging. I'm going to change it to something more useful for now π
Hehe yes, sweet π
@RJ a couple other suggestions here, this is the kind of mutation that should probably have a secret key or require an ENV variable or similar, and heads up you can run mutations like this directly from the Dashboard by opening the console and using the
convexFunctions
global object
Oh thatβs awesome! Thank you Tom!