Question: How many documents are there with the value Tambra Mercure for the name field? How many documents were updated? Run the following statement that will

How many documents are there with the value Tambra Mercure for the name field?
How many documents were updated?

Run the following statement that will add an array for bonus quizzes to the student with

_id 5 / name Wilburn Spiess.

db.students.update(

{ _id: 5 },

{"$set" : {"bonus_quizzes" : [

{ "quiz": 1, "score" : 100 },

{ "quiz": 2, "score" : 80 },

{ "quiz": 3, "score" : 40 },

{ "quiz": 4, "score" : 70 }

]}}

)

need mongodb statement that will add the following five quizzes to the array bonus_quizzes to

the same student (i.e., Wilburn Spiess), sort all bonus quizzes and save only top 5

quizzes. Verify your statement.

i) "quiz": 5, "score" : 80

ii) "quiz": 6, "score" : 30

iii) "quiz": 7, "score" : 40

iv) "quiz": 8, "score" : 99

v) "quiz": 9, "score" : 85

How many update statements did we need to write?

How many documents each of the statements updated?

b. need mogodu statement to modify the value of the program field/key to "Math and

Computer Science" for the student named Tambra Mercure.

Before executing an update statement or a delete statement, you can use the find() method

with the update or delete criteria, to see how many documents will be affected.


Step by Step Solution

3.49 Rating (162 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

How many documents are there with the value Tambra Mercure for the name field We will use the countD... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!