Mongo DB projection – Get the necessary data
In MongoDB, projection means selecting only the necessary data rather than selecting the whole of the data of a document collection. Explained with example. Learn how to use Projection in MongoDB Query to get the selected fields of documents in the output.
Projection is displays data that is useful or filter data and gets the usable one. Removal of unnecessary data from the document
0:do not show
e do not need to write age:0 as above as we write age only . otherwise it will showing error
We should write age only when want to retentive data
now we get both age and name as below