1
Answer

How can i update array of objects using jsonPatch

Dev Teywa

Dev Teywa

3y
679
1

Hello,

i have array of objects like this 

persons =[name:"test",age:24,hobbies:['basket','draw','football']]

if i wanna delete for example delete 'draw" i got

[
    {
        "op": "remove",
        "path": "/hobbies/2"
    },
    {
        "op": "replace",
        "path": "/hobbies/1",
        "value": 'football'
    },
    {
        "op": "replace",
        "path": "/hobbies/0",
        "value": 'basket
    },
]

 

can anyone help me plz ? thanks

Answers (1)