nosql quiz 100% verified
What method instructs the server to not timeout a cursor automatically after a period of
inactivity? (Choose 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 drop 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 above - ANSWER d. db.customers.drop();
What returns 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 will be performing a series of updates to multiple records. You find setting the multi
option of the update() command too tiresome. What should you do instead?
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 can be called 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 instructs the server to not timeout a cursor automatically after a period of
inactivity? (Choose 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 drop 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 above - ANSWER d. db.customers.drop();
What returns 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 will be performing a series of updates to multiple records. You find setting the multi
option of the update() command too tiresome. What should you do instead?
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 can be called 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