I have a Postgres 11.12 database with a table called workflows_emails
with a json column called to
. The to
column has the following format:
[
{
"type":"employee",
"assignment":{
"..."
}
},
{
"type":"external",
"email":"mailbox@foobar.com"
}
]
I would like to update the json array to obfuscate the email
field in all entities where type
field is external
. The resulting array would look like:
[
{
"type":"employee",
"assignment":{
"..."
}
},
{
"type":"external",
"email":"mailbox@foobar.com.SBX"
}
]
Is there a way to do this with a Postgres query?