Subtract $sum from Sub-document
问题 Given the following record in my MongoDB table: { "_id" : ObjectId("5a00c1c71680084c55811ae2"), "name" : "test", "tenantId" : "paul", "price" : 300, "deposits" : [ { "amount" : 100, "date" : ISODate("2017-11-07T14:08:19.324Z"), "_id" : ObjectId("5a01be55424b0f8922a5b472") }, { "amount" : 50, "date" : ISODate("2017-11-87T14:08:19.324Z"), "_id" : ObjectId("5a01be55424b0f8922a5b473") } ], "attention" : "", "due" : ISODate("2017-10-26T22:00:00.000Z") } I would like to filter all the records with