1.

_______ returns the number of elements in the array.(a) $number(b) $size(c) $div(d) None of the mentionedThe question was posed to me during an interview.My question is based upon Pipeline and Sharded Collections topic in section Aggregation Concepts and Aggregation Mechanics of MongoDB

Answer» CORRECT option is (b) $size

To explain I WOULD say: The argument for $size can be any expression as LONG as it RESOLVES to an ARRAY.


Discussion

No Comment Found

Related InterviewSolutions