I have a JSON
object.
I need to change values of all occurrences of a given field of it.
For example:
{
email:"aaa@bbb.com",
person: {
email:"dfd@ffds.com"
},
mother: {
name: "AAA",
email:"fdsfd@fdsfsd.com",
friend: {
email:"fdsd@gfsgf.com"
}
}
}
I need to find all email
fields and change their values
based on their values
.
I know how to iterate through one level of a JSON
, I do not know how to iterate through all levels.
Thank you! :-)