exam questions

Exam DP-420 All Questions

View all questions & answers for the DP-420 exam

Exam DP-420 topic 1 question 46 discussion

Actual exam question from Microsoft's DP-420
Question #: 46
Topic #: 1
[All DP-420 Questions]

HOTSPOT
-

You have an Azure Cosmos DB for NoSQL container that contains the following item.



You need to update the OrderQty value to 5 by using a patch operation.

How should you complete the JSON Patch document? To answer, select the appropriate options in the answer area.

Show Suggested Answer Hide Answer
Suggested Answer:

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
8fe085a
6 months, 2 weeks ago
The answer should be: [{"op": "increment", "path": "/items/0/OrderQty", "value": -5}] See: https://learn.microsoft.com/en-us/azure/cosmos-db/partial-document-update Increment This operator increments a field by the specified value. It can accept both positive and negative values. If the field doesn't exist, it creates the field and sets it to the specified value. Add If the target path specifies an element that already exists, its value is replaced. The value in the question is -5 so using Add would set the node to -5 not 5.
upvoted 3 times
...
[Removed]
7 months, 2 weeks ago
Path option is wrong. Here is the correct JSON [ { "op": "add", "path": "/items/0/OrderQty", "value": 5 } ]
upvoted 3 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...