1.

When using $first in a $group stage, the $group stage should follow a _______ stage to have the input documents in a defined order.(a) $order(b) $sort(c) $asc(d) None of the mentionedThis question was posed to me in an online quiz.Origin of the question is Pipeline Operators topic in division Aggregation Concepts and Aggregation Mechanics of MongoDB

Answer»

Correct option is (B) $sort

To EXPLAIN: $sort takes a document that SPECIFIES the field(s) to sort by and the RESPECTIVE sort order.



Discussion

No Comment Found

Related InterviewSolutions