ALL RIGHTS RESERVED.
Nosql Exam Questions With Verified And
Updated Answers
What method does instruct the server to avoid closing a cursor automatically after a period of
inactivity? (Select one)
a. cursor.noCursorTimeout()
b. cursor.readConcern()
c. cursor.objsLeftInBatch()
d. cursor.readPrefcursor.pretty() - answer✔a. cursor.noCursorTimeout()
Using the MongoDB shell, how do you remove the customer collection and its indexes?
a. db.customers.remove(\{\});
b. db.customers.delete();
c. db.customers.remove(\{\}).indexes();
d. db.customers.drop();
e. none of the mentioned - answer✔d. db.customers.drop();
What does return TRUE if the cursor returned by the db.collection.find() query can iterate
further to return more documents? (Select one)
a. cursor.hasNext()
b. cursor.next()
c. cursor.toArray()
d. db.collection.find()
e. cursor.forEach() - answer✔a. cursor.hasNext()
You are going to do a series of updates to multiple records. You find setting the multi option of
the update() command too tiresome. What should you do instead?
1|Page
, ©THESTAR EXAM SOLUTIONS 2024/2025
ALL RIGHTS RESERVED.
a. all answers correct
b. Use the replaceMany() command instead
c. Use the updateMany() command instead
d. Set the global multi option to True
e. Use the updateMulti() command instead - answer✔c. Use the updateMany() command
instead
What does iterate the cursor to apply a JavaScript function to each document from the cursor?
(Select one)
a. cursor.next()
b. cursor.toArray()
c. cursor.hasNext()
d. cursor.forEach()
e. db.collection.find() - answer✔d. cursor.forEach()
Which of the following line skips the first 5 documents in the bios collection and returns all
remaining documents?
a. db.bios.find().skip(1)
b. db.bios.find().sort(5)
c. db.bios.find().skip(5)
d. all answers correct
e. db.bios.find().limit(5) - answer✔c. db.bios.find().skip(5)
Which of the following methods can be used on a cursor object?
a. cursor.hasNext()
b. cursor.forEach()
c. all answers correct
d. cursor.next()
e. All of the presented - answer✔c. all answers correct
What method appends element to the array if this element doesn't exist already?
2|Page