Exam C100DEV Topic 1 Question 239 Discussion

Actual exam question for MongoDB's C100DEV exam
Question #: 239
Topic #: 1
There is a gamers collection in your database with the following document structure:
{ _id: 1, level: 15, is_active: true }, { _id: 2, level: 14, is_active: true }, { _id: 3, level: 7, is_active: false }
How do you update the value of the level field to 20 for a player with an id = 2?
Expected result:
{ _id: 1, level: 15, is_active: true }, { _id: 2, level: 20, is_active: true }, { _id: 3, level: 7, is_active: false }

Suggested Answer: C Vote an answer

https://docs.mongodb.com/manual/reference/operator/update/set/

by Odelia at Oct 22, 2024, 01:14 AM

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
Nick name: Submit Cancel
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.

0
0
0
10