Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

local DynamoDB deleteItem behaves different compared to AWS DynamoDB #52

Open
bilaal-s opened this issue Sep 3, 2019 · 1 comment
Open

Comments

@bilaal-s
Copy link

bilaal-s commented Sep 3, 2019

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 [email protected] which pulls in [email protected]

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"}
@BLasan
Copy link

BLasan commented Jun 13, 2020

Is this issue still opened?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants