Reputation: 51
Updated: Solved by Sajeetharan's suggestion! Thanks.
I'm trying to implement the api to partially update cosmos db. I got 404 not found when I tested this patch request. I tested query in cosmo's db, it's working as expected. I don't know which part is wrong.
Upvotes: 2
Views: 627
Reputation: 1482
Azure have confusing error message for this.
Upvotes: 0
Reputation: 222712
You should invoke the Patch
on the container as how you have done fetchAll request.
Here is a sample,
const multipleOperations: PatchOperation[] = [
{
op: "add",
path: "/aka",
value: "MeFamily"
},
{
op: "replace",
path: "/lastName",
value: "Jose"
},
{
op: "remove",
path: "/parents"
},
{
op: "set",
path: "/address/zip",
value: 90211
},
{
op: "incr",
path: "/address/zip",
value: 5
}
];
const { resource: patchSource2 } = await container.item(patchId!).patch(multipleOperations);
Upvotes: 1