1.

Which of the following method is called while accessing documents using the array index notation?(a) cur.toArray()(b) cursor.toArray()(c) doc.toArray()(d) all of the mentionedThe question was posed to me in unit test.I'm obligated to ask this question of Getting Started with MongoDB in chapter MongoDB CRUD Concepts and Operation of MongoDB

Answer»

Right OPTION is (b) cursor.toArray()

To explain: The toArray() method RETURNS an array that CONTAINS all the documents from a cursor.



Discussion

No Comment Found

Related InterviewSolutions