是否有某种查询方式可以通过ID获得所有价格总和?
对于所有文档,即使下一个文档具有其他ID?
数据:
{"_id":"5c62d9693ec4721d2ab07f72",
"List1":[{"ID1":"123",
"List2":[{"Price":10,
"Status":"Paid"},
[{"Price":15,
"Status":"Pending"}]]},
{"ID1":"456",
"List2":[{"Price":20,
"Status":"Paid"}]}]}
预期回报:
“ ID1”:“ 123” “总计”:10
“ ID1”:“ 456”, “总计”:20