1.

$addToSet returns an array of all _______ values that results from applying an expression to each document.(a) unique(b) non unique(c) distinct(d) all of the mentionedThis question was addressed to me in an online interview.This intriguing question comes from Pipeline Operators topic in chapter Aggregation Concepts and Aggregation Mechanics of MongoDB

Answer»

The CORRECT answer is (a) unique

The best EXPLANATION: ORDER of the ELEMENTS in the output array is unspecified.



Discussion

No Comment Found

Related InterviewSolutions