milk enjoyer
milk enjoyer11mo ago

Is there a way to delete all files?

Right now, we can only "Load more" 20 files at a time. I have my own scripts that delete based on Id<"_storage">, which works for normal cases, but sometimes because of bugs and experimentation I might lose the storage ID. Would be great if we can "delete all files" for quick experimentation, or at least have some way to find all files where their storage ID is not found in the database to delete it.
4 Replies
ballingt
ballingt11mo ago
You can query the _storage system table to get all storage IDs: https://docs.convex.dev/file-storage/file-metadata
Accessing File Metadata | Convex Developer Hub
Every stored file is reflected as a document in the "_storage" system table.
ballingt
ballingt11mo ago
Does clicking the tiny box at the top of the files table in the dashboard only select the loaded 20? makes sense, we've talked about a gmail-style select all
milk enjoyer
milk enjoyerOP11mo ago
Yes it only selects the loaded 20 ah i see so it should work just like a normal table right
ballingt
ballingt11mo ago
yep, so you still might have to paginate if you have thousands but they're all there

Did you find this page helpful?