0
0
DynamoDBquery~5 mins

UpdateItem basics in DynamoDB - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is the purpose of the UpdateItem operation in DynamoDB?
The UpdateItem operation modifies existing attributes or adds new attributes to an item in a DynamoDB table without replacing the entire item.
Click to reveal answer
beginner
Which parameter in UpdateItem specifies the changes to be made to an item?
The UpdateExpression parameter defines the attributes to update, add, or remove in the item.
Click to reveal answer
beginner
What does the ExpressionAttributeValues parameter do in an UpdateItem request?
It provides the actual values that are substituted into the UpdateExpression to specify what to update.
Click to reveal answer
intermediate
How can you increment a numeric attribute using UpdateItem?
Use the SET action in the UpdateExpression to increase the numeric attribute by a specified value, e.g., SET attribute = attribute + :val.
Click to reveal answer
intermediate
What happens if you try to update an item that does not exist using UpdateItem?
By default, DynamoDB creates a new item with the specified key and attributes if the item does not exist.
Click to reveal answer
Which parameter in UpdateItem defines the attributes to change?
AKey
BReturnValues
CUpdateExpression
DConditionExpression
What does ExpressionAttributeValues provide in an update?
AValues to substitute in the update
BPrimary key
CTable name
DAttribute names
How do you add 5 to a numeric attribute using UpdateItem?
ASET attribute = attribute + 5
BADD attribute 5
CREMOVE attribute 5
DDELETE attribute 5
What does ReturnValues: ALL_NEW do in UpdateItem?
AReturns the item before update
BReturns nothing
CReturns only updated attributes
DReturns the item after update
If the item does not exist, what does UpdateItem do by default?
AFails with error
BCreates a new item
CDeletes the item
DReturns null
Explain how to use UpdateItem to change an attribute value in DynamoDB.
Think about how you tell DynamoDB what to update and what values to use.
You got /4 concepts.
    Describe what happens if you update an item that does not exist in DynamoDB using UpdateItem.
    Consider the default behavior of UpdateItem when the item is missing.
    You got /3 concepts.