Basically, if one field exists, I want to run a query, otherwise, I want to run a separate one.
`db.Collection.aggregate([
{
$match: {
$cond: [{if fieldOnCollection:{$exists:true}}, {fieldOnCollection:'foo'}, {anotherField:'bar'}]
}
}
]);`
I've only ever seen $cond
used in other stages and not to construct an actual part of the query consisting of fields on the collection itself