//我有一个这样的SQL
选择
x.attr1, p.attr2, p2.attr3, o.attr4, p2.attr5, a2.attr6
从TABLE_O o
右连接TABLE_A a ON a.id = o.id AND a.id2为NULL
左联接TABLE_A a2在a2.id = o.id和a2.id2 = a.id3
左联接TABLE_P p a.id4 = p.id4
左连接TABLE_P p2在a2.id4 = p2.id4上
INNER JOIN TABLE_X x ON a.id3 = x.id3
o.type ='someText'和a2.id4
IN(从TABLE_P WHERE TYPE =“ anotherText”中选择id3)
AND x.attr1 =“ someText”
///我需要一个关于如何在mongo聚合上执行此操作的想法,谢谢。