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 <DynamoDbInstance>.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:
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"}
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
<DynamoDbInstance>.deleteItemis 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-localhostthroughserverless-dynamodb-local. We useserverless-dynamo-db@0.2.37which pulls indynamodb-localhost@0.0.7Here is a representation of how we are exuting the deleteItem command:
When the data parameter is not null, dynamodb local responds with the following: