0
在與組所需的輸出MongoDB的排序查詢是具有記錄等我的MongoDB集合...如何得到由
{"type":"ORDER_PLACE", "price":100, "emailId":"[email protected]"}
{"type":"CART_ORDER", "price":150, "emailId":"[email protected]"}
{"type":"ORDER_PLACE", "price":200, "emailId":"[email protected]"}
{"type":"CART_ORDER", "price":350, "emailId":"[email protected]"}
{"type":"CART_ORDER", "price":250, "emailId":"[email protected]"}
{"type":"ORDER_PLACE", "price":240, "emailId":"[email protected]"}
{"type":"ORDER_PLACE", "price":330, "emailId":"[email protected]"}
我想要的結果應該是這樣......
{"emailId":"[email protected]", "type":"ORDER_PLACE", "total":540}
{"emailId":"[email protected]", "type":"ORDER_PLACE", "total":330}
什麼將是排序查詢來獲得上面的結果(desc order)。