Complete the code to specify the index name when querying a GSI.
response = table.query(IndexName=[1], KeyConditionExpression=Key('GSIKey').eq('value'))
You must specify the exact name of the GSI in the IndexName parameter to query it.
Complete the code to use the correct key condition expression for the GSI partition key.
response = table.query(IndexName='MyGSI', KeyConditionExpression=Key('[1]').eq('value'))
The KeyConditionExpression must use the GSI partition key attribute name.
Fix the error in the query code by completing the missing parameter to specify the sort key condition.
response = table.query(IndexName='MyGSI', KeyConditionExpression=Key('GSIKey').eq('value') [1] Key('GSISortKey').lt(100))
| instead of &.Use & to combine multiple conditions in a KeyConditionExpression.
Fill both blanks to complete the query that filters results after querying the GSI.
response = table.query(IndexName='MyGSI', KeyConditionExpression=Key('GSIKey').eq('value'), FilterExpression=Attr('[1]').[2]('active'))
contains when exact match is needed.The filter expression checks if the Status attribute equals 'active'.
Fill all three blanks to build a query that uses a GSI, filters by attribute, and limits results.
response = table.query(IndexName=[1], KeyConditionExpression=Key('GSIKey').eq('value'), FilterExpression=Attr([2]).[3]('pending'), Limit=10)
contains instead of eq for exact match.This query uses the GSI named 'MyGSI', filters items where Category equals 'pending', and limits the results to 10.