Hello @Ezequias_Rocha
the $unionWith aggregation stage which @Justin mentioned looks very promising and will simplify the code a lot. There is a release candidate 4…4.0.rc0 available you may want to try that out (I will next week).
I once had this issue too, but could fix it by adopting the needs to my data model, that is not always possible. Checking stackoverflow I found this anwers (which comes close to the one @Natac13 already posted.)
Hope that helps
Michael
