Complete the code to start a transaction write with multiple operations.
response = client.transact_write_items(TransactItems=[1])The TransactItems parameter requires a list of action dictionaries. Option D correctly provides a list with a Put operation.
Complete the code to add a condition expression to a Put operation in TransactWriteItems.
TransactItems=[{'Put': {'TableName': 'MyTable', 'Item': {'Id': {'S': '123'}}, 'ConditionExpression': [1]]The ConditionExpression "attribute_not_exists(Id)" ensures the item does not already exist before putting it.
Fix the error in the TransactWriteItems call by completing the missing parameter.
client.transact_write_items(TransactItems=[1])The Delete operation requires both TableName and Key to specify which item to delete.
Fill both blanks to create a transaction with a Put and an Update operation.
TransactItems=[{'Put': {'TableName': [1], 'Item': {'Id': {'S': '001'}}}}, {'Update': {'TableName': [2], 'Key': {'Id': {'S': '002'}}, 'UpdateExpression': 'SET #n = :val', 'ExpressionAttributeNames': {'#n': 'Name'}, 'ExpressionAttributeValues': {':val': {'S': 'NewName'}}}}]The Put operation targets the 'Users' table and the Update operation targets the 'Orders' table as specified.
Fill all three blanks to create a transaction with Put, Update, and Delete operations with conditions.
TransactItems=[{'Put': {'TableName': [1], 'Item': {'Id': {'S': '100'}}}}, {'Update': {'TableName': [2], 'Key': {'Id': {'S': '101'}}, 'UpdateExpression': 'SET Age = :age', 'ExpressionAttributeValues': {':age': {'N': '30'}}, 'ConditionExpression': [3], {'Delete': {'TableName': 'Logs', 'Key': {'LogId': {'S': 'log123'}}}}]The Put operation inserts into 'Customers', the Update modifies 'Employees' with a condition that 'Age' exists.