I have the following collection:
{
"_id" : "ak5TEry8rzRjxDqWJ",
"client" : "Client Name",
"title" : "Product Title",
"category" : "box",
"timestamp" : 1497460110992.0,
"order" : [
{
"date" : 1497375153945.0,
"brief" : {
"item" : {
"text" : "item order 0",
"show" : false
},
"quantity" : {
"text" : "edit",
"show" : false
}
},
"dev" : {
"quote" : {
"text" : "edit",
"show" : false
},
"notes" : {
"text" : "edit",
"show" : false
}
}
}
]
}
Inside the array order I will have as many objects as reorders.
How can I update item from brief inside order.array[x]
x is a variable with the element number of the array
I’ve tried to write an update query but failed.
I’m close to giving up and rewrite the DB with an object of objects but does any of you have a solution?