Delete all files
Is there an easy way to clear all files in convex storage? I'm doing 20 at a time and I have 1k total.
9 Replies
Thanks for posting in <#1088161997662724167>.
Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets.
- Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.)
- Use search.convex.dev to search Docs, Stack, and Discord all at once.
- Additionally, you can post your questions in the Convex Community's <#1228095053885476985> channel to receive a response from AI.
- Avoid tagging staff unless specifically instructed.
Thank you!
Hi @Web Dev Cody check out these two threads
https://discord.com/channels/1019350475847499849/1137212457211936808
and https://discord.com/channels/1019350475847499849/1150591587798233169
hmm yeah I think adding a way to get a list of all id's associated with your project to help find orphaned images would be nice
because I had a bug in my code that forgot to delete some images
but now I have like 1,000 images I have to manually go through and check if they have a corresponding convex entry
this is just on dev, but if this was prod and I had real users, idk what I'd even do
like a
ctx.storage.paginate
or somethingYeah this has come up a few times. We have some ideas but haven't had a chance to prioritize them yet. Thanks for the reminder.
can you do
ctx.db.system.query("_storage").paginate(opts)
?
You can also delete all stored files transactionally with a carefully constructed npx convex import
, lmk if you want tips on that 🙂System Tables | Convex Developer Hub
System tables enable read-only access to metadata for built-in Convex features.
@Web Dev Cody is this what you were looking for?
yes, this is perfect
sorry for not seeing that 😅
Ah I yeah, I should have pointed to this api. I was thinking of a generalized case where we can automatically tell you this. That may not happen for a little while.