0

Is there some way to query in order to get as return all the Prices sum by ID?

For all documents, even if the next document has other IDs?

Data:

{"_id":"5c62d9693ec4721d2ab07f72",
       "List1":[{"ID1":"123",
                "List2":[{"Price":10,
                         "Status":"Paid"}, 
                        [{"Price":15,
                        "Status":"Pending"}]]},
                {"ID1":"456",
                "List2":[{"Price":20,
                          "Status":"Paid"}]}]}

Expected return:

"ID1": "123" "Total": 10

"ID1":"456", "Total": 20

Harrison Henri
  • 119
  • 1
  • 12

0 Answers0