Reputation: 2804
s3Bucket.deleteObject({
Bucket: 'assets.memori.my',
Key: key
}, function(err,data){
console.log(data);
res.end();
})
I checked my file did got deleted but what I get in data is an {}, where does the success callback come?
Upvotes: 1
Views: 551
Reputation: 5659
That is expected.
Per the documentation, data
can contain the following params:
DeleteMarker
VersionId
RequestCharged
The first two are relevant only for versioned objects, the 3rd only if the requester doesn't own the bucket. It looks like none of these cases are applicable to you.
How do you know if your request was successful? Per the documentation, your request was successful if err
is null
. For failed requests, data
would be null
.
err (Error) — the error object returned from the request. Set to
null
if the request is successful. data (Object) — Set tonull
if a request error occurs.
Upvotes: 1