Repository navigation
Cloud Storage Delete all files with prefix #680
Description
Activity
Since there's no API call for this, it'd really be a shortcut for...
bucket.getFiles({ prefix: 'directory/'}, function(err, files, ...) { for (var i in files) { files[i].delete(); } });
which could be super misleading about what's actually happening, and might fail half-way through (it wouldn't be an atomic operation). That said, I'll leave this open for discussion...
/cc @stephenplusplus : This (to me) feels like the whole "delete bucket even if it isn't empty" thing where people are going to do it, so we might as well help them do it right (and then if we add an API call to do such a thing, we can swap it for that under the hood without anyone caring).
/cc @Capstan : Any chance we're going to add a long-running operation to delete multiple files in a single request using the same query parameters we provide to
Objects:list?- addedtype: questionRequest for information or clarification. Not an issue.Request for information or clarification. Not an issue.api: storageIssues related to the Cloud Storage API.Issues related to the Cloud Storage API.
on Jun 19, 2015 I think this is a good idea. Will PR.
@jgeewax Support for additional long-running operations is on our roadmap, yes. As for what the method looks like is still undecided. It may not look like list objects at all. It may cleave more to lifecycle management instead. If you have some specific use cases / design goals in mind, it'd be helpful. (e.g., do you care about people adding objects after the operation starts being deleted or not?)
- added a commit that references this issue
on Jan 10, 2023 - added 5 commits that reference this issue
on Jan 27, 2026 1 remaining item
- added 4 commits that reference this issue
on Feb 3, 2026 - added a commit that references this issue
on Feb 17, 2026 - added a commit that references this issue
on Mar 12, 2026 - added a commit that references this issue
on Mar 17, 2026 - added a commit that references this issue
on Mar 18, 2026 - added a commit that references this issue
on Mar 27, 2026 - added a commit that references this issue
on May 5, 2026
It would be nice if there was a bulk delete for files that satisfy a query in a bucket. Something like: