serverless-dynamodb-local icon indicating copy to clipboard operation
serverless-dynamodb-local copied to clipboard

DynamoDB shell returns items - lambda not

Open vmtzkr opened this issue 8 years ago • 0 comments
trafficstars

Actual Behaviour

Lambda function returns zero elements while the same query running in the webbased shell returns values (running all locally).

Expected Behaviour

I would expect, that the same result is returned when running lambda function locally, as well as running the same query used in the lambda function in the webbased shell.

Steps to reproduce it

Request

var params = {
  TableName: 'schools',
  FilterExpression: '#school_name = :value',
  ExpressionAttributeNames: { '#school_name': 'name' },
  ExpressionAttributeValues: { ':value': { S: 'School 1' } }
};
dynamodb.scan(params, function(err, data) {
    if (err) ppJson(err); // an error occurred
    else ppJson(data); // successful response
});

Response in the webbased shell

{ Items: [............],
  Count: 74,
  ScannedCount: 74,
  LastEvaluatedKey: { id: '6fcbcaf8-d4fc-4484-a74f-7ce9b18cbc6f' } }

Response in the lambda function

{ Items: [],
  Count: 0,
  ScannedCount: 74,
  LastEvaluatedKey: { id: '6fcbcaf8-d4fc-4484-a74f-7ce9b18cbc6f' } }

Would you like to work on the issue?

No able to resolve the issue myself.

vmtzkr avatar Oct 16 '17 09:10 vmtzkr