SERVER-139188In Code Review
Implement type narrowing for the remaining comparisons expressions
Follow up from SERVER-135984. After $eq works, the logic should be expanded to: $lt, $lte, $gt, $gte, $ne. Not $cmp - it will not be supported and it returns a number. $lt:["$a", "string"] constrains 'a' to be of the type string and types that sort before string. Should probably look like 'minKey|missing|null|undefined|number|string'. $ne does nothing unless the type is a singleton type - $ne: ["$a", "string"] cannot tell us the type of "a" but a != null can tell us it's not null.