Conditional $lookup

Because the example is part of a much larger aggregation doing other pipeline operations. So running it as two separate aggregations is much less optimal. And yes, $facet hitting that limit would be an issue (it’s 16mb, not Gb… Gb would be great lol).

But I appreciate the thought!

It would be awesome if there was a way to only conditionally $lookup. Oh well!

1 Like