Summary
Mongo introduced simplified syntax and capabilities for version >5. The PR here refactors the main pipelines to be compatible with <5 and >=5. If this becomes too much of a burden, and since this was a PSI requirement, we should consider dropping the <5 compatibility once PSI has upgraded and in case it becomes hard to maintain.