local DynamoDB deleteItem behaves different compared to AWS DynamoDB
- Dominant language
- JavaScript
- Stars
- 34
- Forks
- 87
- PR merge metrics
- No merged PRs in 30d
Description
We have found in our use of DynamoDB local that the response from real AWS DynamoDB and Local DynamoDB are different when you attempt to delete data which does not exist. When using DynamoDB local the callback for `.deleteItem` is called with a non-null value for the data parameter, however, for real AWS DynamoDB the callback is called with null for the data parameter.
We use` dynamodb-localhost` through `serverless-dynamodb-local`. We use `serverless-dynamo-db@0.2.37` which pulls in `dynamodb-localhost@0.0.7`
Here is a representation of how we are exuting the deleteItem command:
```javascript
var params = {
Key: invalidKey, // key that does not exist
TableName: "validTable" // table exists
};
dynamodb.deleteItem(params, function(err, data) {
// data here should be null, which is the correct AWS behaviour
if (err) console.log(err, err.stack);
else console.log(data);
});
```
When the data parameter is not null, dynamodb local responds with the following:
```
{"ConsumedCapacity":{"TableName":"validTable","CapacityUnits":1},"LOG_ID":"cqg6"}
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the deleteItem call for a nonexistent key with dynamodb-localhost@0.0.7, using the parameters shown in the issue, and compare its callback data with real AWS DynamoDB. Trace the deleteItem entry point and verify that the completed behavior returns null data without the extra ConsumedCapacity response.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100