I have a column that saves JSON string and I want to get rid of "zipcode" for that JSON object. How can I achieve that using MySQL functions?
{name:"Alex", "address": [
{"type": "primary", "street": "bakers street", "zipcode": 90001},
{"type": "secondary", "street": "honor street", "zipcode": 90002}
]
}
I tried this one
select JSON_REMOVE(JSON_EXTRACT(JSON_EXTRACT(@payload_json,'$. address'), '$[0]'),'$. zipcode')
but it results like
{"type": "primary", "street": "bakers street",},
{"type": "secondary", "street": "honor street", "zipcode": 90002}
]
}```
> Is there a way I could do it all at once?