Recall & Review
beginner
What does a Scan operation do in DynamoDB?
A Scan reads every item in a table and returns all data attributes by default. It examines all items, which can be slow for large tables.
Click to reveal answer
beginner
What is a Filter Expression in a DynamoDB Scan?
A Filter Expression lets you specify conditions to filter the results returned by a Scan. It does not reduce the read workload but filters data after reading.
Click to reveal answer
beginner
How does a Filter Expression affect the data returned by a Scan?
It filters out items that don't match the condition after scanning all items. Only matching items are returned to you.
Click to reveal answer
intermediate
Why might using a Filter Expression still be costly in DynamoDB?
Because Scan reads all items before filtering, it consumes read capacity for every item scanned, even if many are filtered out.
Click to reveal answer
beginner
Give an example of a simple Filter Expression in a DynamoDB Scan.
Example: To find items where attribute 'status' equals 'active', use FilterExpression: "#s = :val" with ExpressionAttributeNames: {"#s": "status"} and ExpressionAttributeValues: {":val": "active"}.
Click to reveal answer
What does a Filter Expression do in a DynamoDB Scan?
✗ Incorrect
Filter Expressions filter the results after scanning all items; they do not prevent scanning.
Which statement is true about Scan with Filter Expression?
✗ Incorrect
Scan reads all items in the table, then applies the Filter Expression to filter results.
Why might Scan with Filter Expression be inefficient?
✗ Incorrect
Scan reads every item, which can be slow and costly, even if many are filtered out.
What is needed to use a Filter Expression in DynamoDB Scan?
✗ Incorrect
You need both FilterExpression and ExpressionAttributeValues to specify conditions and values.
If you want to find items where 'age' > 30 using Scan, what would you use?
✗ Incorrect
FilterExpression with ExpressionAttributeValues is used to filter items after scanning.
Explain how a Scan with Filter Expression works in DynamoDB and why it might be costly.
Think about when filtering happens during the Scan process.
You got /4 concepts.
Describe a simple example of using a Filter Expression in a DynamoDB Scan operation.
Focus on the syntax and purpose of FilterExpression.
You got /4 concepts.