What is Projection Operators? List some Projection Operators available in MongoDB?

Sharad Jaiswal
Sharad Jaiswal

Posted On: Jun 24, 2021

 

In MongoDB, projection operators are used for selecting only the necessary data rather than selecting the whole of the data of a document. Some of the Projection Operators available in MongoDB are:

  • $ - Projects the first element in an array that matches the query condition.
  • $elemMatch - Projects the first element in an array that matches the specified $elemMatch condition. 
  • $meta - Projects the available per-document metadata.
  • $slice - Limits the number of elements projected from an array. 

    Related Questions

    Please Login or Register to leave a response.

    Related Questions

    MongoDB Interview Questions

    What do you know about MongoDB?

    MongoDB is a cross-platform document-oriented database program which is open source and free in nature. It can also be..

    MongoDB Interview Questions

    List the important features of MongoDB.

    The important features of MongoDB are listed below: –Aggregation framework– it uses aggregation framework for the..

    MongoDB Interview Questions

    Which all languages can be used with MongoDB?

    Here goes a list of the languages which can be used with MongoDB: – C C++ C# Java Node.js Perl PHP Python Ruby Scala..