Complete the code to perform a Scan operation on a DynamoDB table named 'Products'.
response = dynamodb_client.[1](TableName='Products')
The Scan operation reads every item in the table, which is why it reads the entire table.
Complete the code to add a filter expression to the Scan operation to reduce the items returned.
response = dynamodb_client.scan(TableName='Products', FilterExpression=[1])
The Attr function is used in FilterExpression to filter items by attribute values during a Scan.
Fix the error in the Scan code that tries to use KeyConditionExpression.
response = dynamodb_client.scan(TableName='Products', [1]=Key('Category').eq('Books'))
Scan does not support KeyConditionExpression. Use FilterExpression to filter items after scanning.
Fill both blanks to create a dictionary comprehension that maps product names to their prices from a Scan response.
prices = {item['[1]']: item['[2]'] for item in response['Items']}We use 'ProductName' as the key and 'Price' as the value to create the dictionary.
Fill all three blanks to create a Scan call that reads the entire table with a limit and returns only the 'ProductName' attribute.
response = dynamodb_client.scan(TableName='Products', [1]=5, [2]='[3]')
Limit sets the max items to read, ProjectionExpression selects attributes to return, here 'ProductName'.