SERVER-13104 enumerate all possibilties for $or below an $and

(cherry picked from commit aac8ba84d8fac7dc531a03c63224fdfc8cd3baa3)