At times you want to reduce extra data sent by the server to the client. For example, let us say you have an “address” collection and you wish to retrieve only City names.

In a SQL database, you would achieve this by

   SELECT City FROM ADDRESS

instead of

   SELECT * FROM ADDRESS

To achieve the same affect in MongoDB, simply mention the items you wish to fetch (within the resulting documents) in the “Fields” popout box.

image

You may refer to MongoDB documentation here.

Tags: , ,