I need to delete multiple objects from google cloud storage. I have deleted one object at a time.
This is my code:
var gcloud = require('gcloud')({
projectId: "sampleProject1"
});
var gcs = gcloud.storage();
var myBucket = gcs.bucket('sampleBucket1');
var file = myBucket.file('1.png');
file.delete(function (err, apiResponse) {
if (err) {
console.log(err);
}
else {
console.log("Deleted successfully");
}
});
But I need to delete multiple objects simultaneously. Is it possible or not?
await
aPromise.all()
call with the mapped array. – Fante