1.

Which of the following is used to retrieve like SELECT clause in SQL?(a) $reduce(b) $select(c) $project(d) None of the mentionedThe question was asked in an online interview.This is a very interesting question from SQL to Aggregation Mapping Chart in section Aggregation Concepts and Aggregation Mechanics of MongoDB

Answer» RIGHT CHOICE is (c) $project

To explain: The $project takes a DOCUMENT that can specify the INCLUSION of fields, the suppression of the _id field, the addition of NEW fields, and the resetting the values of existing fields.


Discussion

No Comment Found

Related InterviewSolutions