Docs Menu
Docs Home
/ /

Project Fields to Return from Query

You can use projection to select which document fields to return from a query by using the following methods:

  • Your programming language's driver.

  • The MongoDB Atlas UI. To learn more, see Project Fields to Return from a Query with MongoDB Atlas.

  • MongoDB Compass.

By default, queries in MongoDB return all fields in matching documents. To limit the amount of data that MongoDB sends to applications, you can include a projection document to specify or restrict fields to return.

Tip

Back

Arrays of Embedded Documents

On this page