Is there a way to return specific nested fields from a query in MongoDB?
问题 Is there a way to get the amount of money paid per Sport's category ? It can't be restricted only to "John," but in all collection documents. Expected query return for data provided: { {"Fight": [100,95] }, {"Running": [50] } } Example of data: {"_id":"5z621578b0ce483b9866fb1f", "Name":"John", "Sports":[ {"Category":"Fight", "Billing":[ {"Month":"Jan", "Status":"Paid", "Price":100}, {"Month":"Feb", "Status":"Not Paid", "Price":125}, {"Month":"Mar", "Status":"Paid", "Price":95} ] }, {"Category