I need to update an Ingredient in the ingredient list. Until then I just know how to update the entire JSON. How do I update only one item in the array?
{
"_id" : ObjectId("573c721f75fe72149c4d9987"),
"className" : "br.com.teste.productdatasheet.dto.Datasheet",
"name" : "Donut",
"size" : "Normal",
"weight" : {
"value" : 250,
"unit" : "g"
},
"ingredients" : [
{
"name" : "Farinha de Trigo",
"brand" : "Dona Benta",
"packing" : "Saco",
"packingAmount" : {
"value" : 5,
"unit" : "kg"
},
"requiredAmount" : {
"value" : 450,
"unit" : "g"
},
"price" : 5.89
},
{
"name" : "Leite",
"brand" : "Qualquer",
"packing" : "Caixa",
"packingAmount" : {
"value" : 1,
"unit" : "l"
},
"requiredAmount" : {
"value" : 500,
"unit" : "ml"
},
"price" : 2.3
},
{
"name" : "Açúcar",
"brand" : "Qualquer",
"packing" : "Saco",
"packingAmount" : {
"value" : 5,
"unit" : "kg"
},
"requiredAmount" : {
"value" : 300,
"unit" : "g"
},
"price" : 9.8
}
]
}