content_image/668474.jpg
Projections, which are the second argument to the find() method, may either specify a list of fields to return or list fields to exclude in the result documents. 

Important: Except for excluding the _id field in inclusive projections, you cannot mix exclusive and inclusive projections. 

Consider the following diagram of the query process that specifies a query criteria and a projection: 

<img src='content_image/668474.jpg'>

In the diagram, the query selects from the users collection. The criteria matches the documents that have age equal to 18 . Then the projection specifies that only the name field should return in the matching documents. 

## Projection Examples 

## Exclude One Field From a Result Set 

db.records.find( { "user_id": { $lt: 42 } }, { "history": 0 } ) 

This query selects documents in the records collection that match the condition { "user_id": { $lt: 42 } } , and uses the projection { "history": 0 } to exclude the history field from the documents in the result set. 

## Return Two fields and the _id Field 

db.records.find( { "user_id": { $lt: 42 } }, { "name": 1, "email": 1 } ) 

This query selects documents in the records collection that match the query { "user_id": { $lt: 42 } } and uses the projection { "name": 1, "email": 1 } to return just the _id field (implicitly included), name field, and the email field in the documents in the result set. 

