Bird
0
0

You want to update an attribute "Score" only if the current "Score" is less than 100 in a DynamoDB item. Which feature helps achieve this safely?

hard📝 Application Q9 of 15
AWS - DynamoDB
You want to update an attribute "Score" only if the current "Score" is less than 100 in a DynamoDB item. Which feature helps achieve this safely?
AOverwrite the attribute without conditions
BUse a conditional update with a ConditionExpression
CDelete and recreate the item
DUse a Scan operation to find items first
Step-by-Step Solution
Solution:
  1. Step 1: Understand conditional updates in DynamoDB

    ConditionExpression allows updates only if a condition is true.
  2. Step 2: Apply condition to update "Score" only if less than 100

    Use ConditionExpression "Score < :val" to ensure safe update.
  3. Final Answer:

    Use a conditional update with a ConditionExpression -> Option B
  4. Quick Check:

    Conditional update = safe attribute change [OK]
Quick Trick: Use ConditionExpression to control updates [OK]
Common Mistakes:
  • Overwriting without condition
  • Deleting items unnecessarily
  • Using Scan instead of update

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More AWS Quizzes