When we have a rooted $or query which triggers subplanning, we need to make sure results are correct. The case for distinct() should be fine; however, the aggregation() command path could be incorrect if we apply a non-distinct scan to one of the $or branches, but still rewrite the query to a $groupByDistinct
We should make sure we avoid $groupByDistinct in any case where one branch uses an index scan, & add subplanning cases for both.