AWS Certified Developer Associate DVA-C02 Practice Question

A Node.js game backend stores player data in an Amazon DynamoDB table named Players, where PlayerID is the partition key. After each session the service must update only the Score attribute for a given player. Which AWS SDK for JavaScript (v2 DocumentClient) code snippet accomplishes this with a single request and without changing other attributes?

  • docClient.update({TableName: 'Players', Key: , UpdateExpression: 'ADD Score :inc', ExpressionAttributeValues: {':inc': scoreIncrement}})

  • docClient.put({TableName: 'Players', Item: {PlayerID: playerId, Score: newScore}})

  • docClient.update({TableName: 'Players', Key: , UpdateExpression: 'SET Score = :newScore', ExpressionAttributeValues: {':newScore': newScore}})

  • docClient.get({TableName: 'Players', Key: }, function(err, data) { if (!err) { data.Item.Score = newScore; docClient.put({TableName: 'Players', Item: data.Item}); }})

AWS Certified Developer Associate DVA-C02
Development with AWS Services
Your Score:
Settings & Objectives
Random Mixed
Questions are selected randomly from all chosen topics, with a preference for those you haven’t seen before. You may see several questions from the same objective or domain in a row.
Rotate by Objective
Questions cycle through each objective or domain in turn, helping you avoid long streaks of questions from the same area. You may see some repeat questions, but the distribution will be more balanced across topics.

Check or uncheck an objective to set which questions you will receive.

Bash, the Crucial Exams Chat Bot
AI Bot