-
Type: Improvement
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
Labels:
-
Environment:
*Location*: http://docs.mongodb.org/manual/reference/aggregation/operator-conditional/
*User-Agent*: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.71 Safari/537.36
*Referrer*: http://docs.mongodb.org/manual/reference/aggregation/eq/
*Screen Resolution*: 1920 x 1080
*repo*: docs
*source*: reference/aggregation/operator-conditional
*Location*: http://docs.mongodb.org/manual/reference/aggregation/operator-conditional/ *User-Agent*: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.71 Safari/537.36 *Referrer*: http://docs.mongodb.org/manual/reference/aggregation/eq/ *Screen Resolution*: 1920 x 1080 *repo*: docs *source*: reference/aggregation/operator-conditional
The pages states:
$cond - "Evaluates a an expression and returns a boolean."
As far as I've understood, by looking at the detailed docs for $cond, $cond doesn't necessarily return a boolean (it could, though), but rather "evaluates an expression and returns one value for a "truthy" evaluation and one for a "falsy"."