Bird
0
0

Which of the following is the correct syntax to perform a put operation using AWS SDK for JavaScript v3?

easy📝 Syntax Q3 of 15
AWS - DynamoDB
Which of the following is the correct syntax to perform a put operation using AWS SDK for JavaScript v3?
Aconst command = new DeleteItemCommand({ TableName: 'MyTable', Key: key }); await client.send(command);
Bconst command = new GetItemCommand({ TableName: 'MyTable', Key: key }); await client.send(command);
Cconst command = new QueryCommand({ TableName: 'MyTable', KeyConditionExpression: 'id = :id', ExpressionAttributeValues: { ':id': { S: '123' } } }); await client.send(command);
Dconst command = new PutItemCommand({ TableName: 'MyTable', Item: item }); await client.send(command);
Step-by-Step Solution
Solution:
  1. Step 1: Identify the correct command for put operation

    The PutItemCommand is used to insert or replace an item.
  2. Step 2: Verify syntax matches put operation

    The syntax includes TableName and Item properties, matching const command = new PutItemCommand({ TableName: 'MyTable', Item: item }); await client.send(command);.
  3. Final Answer:

    const command = new PutItemCommand({ TableName: 'MyTable', Item: item }); await client.send(command); -> Option D
  4. Quick Check:

    Put syntax = PutItemCommand with Item [OK]
Quick Trick: Put uses PutItemCommand with Item property [OK]
Common Mistakes:
  • Using GetItemCommand for put
  • Missing Item property
  • Confusing QueryCommand with PutItemCommand

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More AWS Quizzes