Bird
0
0

What happens after executing this DynamoDB Document Client put operation?

medium📝 query result Q5 of 15
DynamoDB - with AWS SDK
What happens after executing this DynamoDB Document Client put operation?
const params = { TableName: 'Inventory', Item: { itemId: 'I200', quantity: 50 } };
await client.put(params);
const result = await client.get({ TableName: 'Inventory', Key: { itemId: 'I200' } });
console.log(result.Item);
A{ itemId: 'I200', quantity: 50 }
Bnull
CAn error due to missing Key attribute
D{ quantity: 50 }
Step-by-Step Solution
Solution:
  1. Step 1: Understand put operation

    The put method inserts or replaces the entire item in the table.
  2. Step 2: Understand get operation

    The subsequent get retrieves the item by its key, returning the full item.
  3. Final Answer:

    { itemId: 'I200', quantity: 50 } -> Option A
  4. Quick Check:

    Put inserts full item; get returns it [OK]
Quick Trick: Put replaces item; get returns full item [OK]
Common Mistakes:
MISTAKES
  • Expecting partial item after put
  • Assuming put requires Key separately
  • Thinking get returns null after put

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More DynamoDB Quizzes