Complete the code to query items in ascending order by sort key.
response = table.query(
KeyConditionExpression=Key('UserId').eq('123'),
ScanIndexForward=[1]
)Setting ScanIndexForward=True returns results in ascending order by the sort key.
Complete the code to query items in descending order by sort key.
response = table.query(
KeyConditionExpression=Key('UserId').eq('456'),
ScanIndexForward=[1]
)Setting ScanIndexForward=False returns results in descending order by the sort key.
Fix the error in the query to order results ascending by sort key.
response = table.query(
KeyConditionExpression=Key('UserId').eq('789'),
ScanIndexForward=[1]
)The ScanIndexForward parameter must be a boolean, not a string.
Fill both blanks to query items for UserId '101' in descending order.
response = table.query(
KeyConditionExpression=Key([1]).eq([2]),
ScanIndexForward=False
)The partition key is 'UserId' and the value to match is '101'.
Fill all three blanks to query items for UserId '202' in ascending order with correct key and value.
response = table.query(
KeyConditionExpression=Key([1]).eq([2]),
ScanIndexForward=[3]
)Use 'UserId' as the key, '202' as the value, and True for ascending order.
