I have following doc with doc key cart::16
{
"_type": "NSCart",
"_metadata": {
"created_at": 1473075845614,
"updated_at": null
},
"_id": "f28bc609-6aba-47e5-8e83-5bee2397566f",
"userId": "B1HvmsLj57c9235c",
"items" : [{
"itemId": "N1d55j8m4xr",
"seller": "ByD9T4Ks57cbbd8e",
"license": null,
"basePrice": 0
},{
"itemId": "L9nd6Dswl4v",
"seller": "ByD9T4Ks57cbbd8e",
"license": E122,
"basePrice": 500,
"eCharge": 10,
"total": 510
}]
}
now i want to update a doc where item id is N1d55j8m4xr like this and doc is not predictable so i can not use array_replace for this so is this possible with one n1ql query otherwise i have to do it with serverside or with 2 query
{
“itemId”: “N1d55j8m4xr”,
“seller”: “ByD9T4Ks57cbbd8e”,
“license”: null,
“basePrice”: 590,
“eCharge”: 18,
“total”: 608
}