1.

Point out the wrong statement.(a) $weekDay returns the week number for a date as a number between 0 and 53 (leap year)(b) $cond accepts either two expressions in an ordered list or three named parameters(c) $toLower only has a well-defined behavior for strings of ASCII characters(d) None of the mentionedThis question was posed to me during an interview.This key question is from Pipeline Operators topic in chapter Aggregation Concepts and Aggregation Mechanics of MongoDB

Answer»

Correct answer is (B) $cond accepts either two expressions in an ordered LIST or three named parameters

The BEST I can explain: $cond is a ternary operator that EVALUATES one EXPRESSION, and depending on the result, returns the value of one of the other two expressions.



Discussion

No Comment Found

Related InterviewSolutions