我想在Java中实现聚合查询。
我的输入对象是
[{date:“ 1-2-2009”,cars:[{name:“ car1”,type:“ type1”},{name:“ car2”,type:“ type2”}]]},{date :“ 1-3-2009”,汽车:[{name:“ car3”,类型:“ type3”},{name:“ car4”,类型:“ type4”}]}]]
Aggregation agg = Aggregation.newAggregation(unwind(“ $ cars”),Aggregation.project()。and(“ carList”)。nested(Fields.fields(“ name”,“ brand”)))); >
但是在输出中,我把汽车当作一个空的物体。有人,请帮助我解决。 预先感谢。