Question 6 of 152

Given the following sample documents in the HR collection:

{ “name” : “A.S”, “age”: 23, “hobby”: [ “soccer”, “basketball” ]}

{ “name” : “B.M”, “age”: 36, “hobby”: [ “soccer”, “baseball” ]}

{ “name” : “C.W”, “hobby”: [ “basketball”, “cycling” ]}

{ “name” : “R.S”, “age”: 30, “hobby”: [ “soccer”, “cycling”, “baseball” ]}

{ “name” : “E.M”, “age”: 25, “hobby”: [ “cycling”, “basketball” ]}

What is the output of -

  • db.HR.find( { age: { $in: [ 25, 36] } }, { _id: 0} )
Answer

Suggested Answer

The suggested answer is E.

Question 7 of 152

The name is M.M., the date of the exam is May 20, 2022, the subject is Math, and the score is 90.

What command will properly add this document to the exams collection?

Answer

Suggested Answer

The suggested answer is B.

Question 8 of 152

Given the following sample documents:

{ _id: 1, firstName: “Person1”, company: “CompanyA”, active: false }

{ _id: 2, firstName: “Person2”, company: “CompanyB”, active: false }

{ _id: 3, firstName: “Person3”, company: “CompanyC”, active: true }

{ _id: 4, firstName: “Person4”, company: “CompanyD”, active: true }

What code block should be used to delete the third document from a MongoDB collection in Java?

Answer

Suggested Answer

The suggested answer is D.

Question 9 of 152

Given the following query generates a collection scan:

db.grades.find({“class_id” : 149, “scores.score” : {$gt : 75 }}). sort ({“score.type”:1})

Which two indexes improve the performance of the query the most? (Choose two.)

Answer

Suggested Answer

The suggested answer is C, D.

Question 10 of 152

Given the following query:

db.test.find( { reports: { $elemMatch: { item: “123”, point: { $gte: 8 }}}}

Which two documents from collection test will be returned by this query? (Choose two.)

Answer

Suggested Answer

The suggested answer is B, D.