I have a document like below:
{
"_id" : ObjectId("52e51809454115b7c5d593a4"),
"usage" : {
"from" : "2013-12-02T00:00:00+01:00",
"to" : "2014-02-02T00:00:00+01:00",
"used" : 674999999,
"total" : NumberLong(4000000000)
},
"refills" : [
{
"id" : "RXh0cmEgU3VyZnZvbHlt",
"amount" : 1000000000,
"fee" : "5520",
"feeVat" : "6900",
"validTo" : "2014-02-02T00:00:00+01:00"
}
],
}
Where i would like to update the value "total" in "usage" and add to it the value "amount" in "refills" All other values should be the same.
How do i do that best?