steevej
(Steeve Juneau)
2
It is indeed not acceptable. Most likely because it looks like a normalized SQL schema. The aggregation also looks like it is redacted from the real thing because all parameters became parafoots when converted from metric to US. (I am pretty sure you have no collection called colelction3). It is misspelled twice as when you do global substitute with the wrong text.
What is the real use case? Is it a migration process to permanently convert from an SQL schema to a better schema?
You system might be starving on memory with that much data in a single pipeline. You could investigate doing each $lookup/$merge in completely independent pipelines of each others. You may then avoid an $unwind for collections where foreignField is _id.
1 Like