1.

Which of the operator is similar to order by clause in RDBMS?(a) $sort(b) $match(c) $sortby(d) None of the mentionedI had been asked this question in an interview.Origin of the question is SQL to Aggregation Mapping Chart in section Aggregation Concepts and Aggregation Mechanics of MongoDB

Answer» CORRECT OPTION is (a) $sort

To explain I would say: In the mongo shell, when you ASSIGN the CURSOR returned from the find() method to a variable using the var keyword, the cursor does not AUTOMATICALLY iterate.


Discussion

No Comment Found

Related InterviewSolutions