Complete the code to scan the DynamoDB table with a filter expression to get items where the attribute 'Status' equals 'Active'.
response = table.scan(FilterExpression=Attr('Status')[1]'Active')
The Attr('Status').eq('Active') method creates a filter expression to select items where 'Status' equals 'Active'.
Complete the code to scan the table and filter items where the 'Age' attribute is greater than 30.
response = table.scan(FilterExpression=Attr('Age')[1]30)
lt which means less than.The Attr('Age').gt(30) method filters items where 'Age' is greater than 30.
Fix the error in the filter expression to scan items where 'Category' is not equal to 'Electronics'.
response = table.scan(FilterExpression=Attr('Category')[1]'Electronics')
neq.The correct method to check 'not equal' is ne(). Using .ne('Electronics') creates the right filter expression.
Fill both blanks to scan items where 'Price' is less than 100 and 'InStock' is true.
response = table.scan(FilterExpression=Attr('Price')[1]100) & Attr('InStock')[2]True)
Use .lt(100) to filter prices less than 100 and .eq(True) to filter items where 'InStock' is true.
Fill all three blanks to scan items where the 'Rating' is greater than or equal to 4, 'Category' equals 'Books', and 'Available' is true.
response = table.scan(FilterExpression=(Attr('Rating')[1]4) & (Attr('Category')[2]'Books') & (Attr('Available')[3]True))
Use .gte(4) for 'greater than or equal to 4', and .eq('Books') and .eq(True) for equality checks.