Complete the code to query items with a specific partition key.
response = table.query(KeyConditionExpression=Key('UserId').eq([1]))
You need to provide the partition key value as a string inside quotes.
Complete the code to query items where the sort key is greater than a given value.
response = table.query(KeyConditionExpression=Key('UserId').eq('user123') & Key('Timestamp').[1](1000))
The sort key condition 'gt' means greater than the given value.
Fix the error in the code to query items where the sort key begins with a prefix.
response = table.query(KeyConditionExpression=Key('UserId').eq('user123') & Key('Timestamp').[1]('2023-'))
The correct method to check prefix in DynamoDB is 'begins_with'.
Fill both blanks to query items with partition key 'user123' and sort key less than 5000.
response = table.query(KeyConditionExpression=Key([1]).eq([2]) & Key('Timestamp').lt(5000))
The partition key is 'UserId' and its value is 'user123'.
Fill all three blanks to query items where partition key is 'user123', sort key begins with '2023-', and sort key is greater than 1000.
response = table.query(KeyConditionExpression=Key([1]).eq([2]) & Key([3]).begins_with('2023-') & Key('Timestamp').gt(1000))
The partition key is 'UserId' with value 'user123'. The sort key is 'Timestamp' which begins with '2023-' and is greater than 1000.