1
votes

I am doing FilterExpression with boto3 library and looking for a username in a table that has 4 entries in that table. FilterExpression is returning only 1 record and LastEvaluationKey with unique_id in it. When I pass that unique_id to get more values for that user, I get different data set.

def lambda_handler(event,context):
    username="john"
    response = emp_info.scan(
        FilterExpression=Attr('username').eq(username)
    )
    print response

and when I see response and pass the value of "LastEvaluationKey", I see a different data set for different user.

How can I get all rows for the user and not random data set? I can confirm that user has 4 records in dynamodb.

1

1 Answers

0
votes

So, if I recursively pass the username and "LastEvaluatedKey" to the function, it returns all the data and then by chaining, I can get the complete list.