MongoDB Documentation, Release 3.0.4 db.records.find( { "user_id": { $lt: 42} }, { "_id": 0, "name": 1 , "email": 1 } ) This query selects documents in the records collection that match the query { "user_id": { $lt: 42} } , and only returns the name and email fields in the documents in the result set. Limit Fields to Return from a Query (page 107) for more examples of queries with projection statements. Return Two Fields and Exclude _id See Cursors Cursor Behaviors 1 You can use the DBQuery.shellBatchSize to change the number of iteration from the default value 20 . See Executing Queries (page 273) for more information. Chapter 3. MongoDB CRUD Operations 64 Closure of Inactive Cursors By default, the server will automatically close the cursor after 10 minutes of inactivity or if client has exhausted the cursor. To override this behavior, you can specify the noTimeout flag in your query using cursor.addOption() ; however, you should either close the cursor manually or exhaust the cursor. In the mongo shell, you can set the noTimeout flag: var myCursor = db.inventory.find().addOption(DBQuery.Option.noTimeout); See your driver documentation for information on setting the noTimeout flag. For the mongo shell, see cursor.addOption() for a complete list of available cursor flags. Cursor Isolation Because the cursor is not isolated during its lifetime, intervening write operations on a document may result in a cursor that returns a document more than once if that document has changed. To handle this situation, see the information on snapshot mode (page 754). To manually iterate the cursor to access the documents, see Iterate a Cursor in the mongo Shell (page 110). db.inventory.find( { type: 'food' } ); For example, in the mongo shell, the following read operation queries the inventory collection for documents that have type equal to ’food’ and automatically print up to the first 20 matching documents: To access the documents, you need to iterate the cursor. However, in the mongo shell, if the returned cursor is not assigned to a variable using the var keyword, then the cursor is automatically iterated up to 20 times 1 to print up to the first 20 documents in the results. In the mongo shell, the primary method for the read operation is the db.collection.find() method. This method queries a collection and returns a cursor to the returning documents. Projection Behavior MongoDB projections have the following properties: • By default, the _id field is included in the results. To suppress the _id field from the result set, specify _id: 0 in the projection document. • For fields that contain arrays, MongoDB provides the following projection operators: $elemMatch , $slice , and $ . • For related projection functionality in the aggregation framework (page 439) pipeline, use the $project pipeline stage.