MongoDB Documentation, Release 3.0.4 Collection Help Cursor Help • To see the list of collections in the current database, use the show collections command: • To see the help for methods available on the collection objects (e.g. db.<collection> ), use the show collections db.<collection>.help() method: db.collection.help() <collection> can be the name of a collection that exists, although you may specify a collection that doesn’t exist. • To see the collection method implementation, type the db.<collection>.<method> name without the parenthesis ( () ), as in the following example which will return the implementation of the save() method: db.collection.save When you perform read operations (page 61) with the find() method in the mongo shell, you can use various cursor methods to modify the find() behavior and various JavaScript methods to handle the cursor returned from the find() method. • To list the available modifier and cursor handling methods, use the db.collection.find().help() command: db.collection.find().help() <collection> can be the name of a collection that exists, although you may specify a collection that doesn’t exist. • To see the implementation of the cursor method, type the db.<collection>.find().<method> name without the parenthesis ( () ), as in the following example which will return the implementation of the toArray() method: db.collection.find().toArray Some useful methods for handling cursors are: • hasNext() which checks whether the cursor has more documents to return. • next() which returns the next document and advances the cursor position forward by one. • forEach(<function>) which iterates the whole cursor and applies the <function> to each document returned by the cursor. The <function> expects a single argument which corresponds to the document from each iteration. For examples on iterating a cursor and retrieving the documents from the cursor, see cursor handling (page 64). See also js-query-cursor-methods for all available cursor methods. 5.2. Administration Tutorials 277 db.updateUser