I use a default response for a user in my proyect according to the following table.
Table: USERS |ID | NAME | DEFAULTRESPONSE
The default response contains a string in JSON format. I need to change the month and the day from all relatives_birthdays from string to int.
Here is an example of the previous json:
[
{
"id":1,
"relatives_birthdays":[
{
"month":"8",
"day": "1",
"description": "Birthday mother"
},
{
"month":"3",
"day": "27",
"description": "Birthday brother"
},
{
"month":"4",
"day": "12",
"description": "Birthday father"
}
]
},
{
"id":2,
"relatives_birthdays":[
{
"month":"12",
"day": "11",
"description": "Birthday mother"
},
{
"month":"1",
"day": "2",
"description": "Birthday brother"
},
{
"month":"7",
"day": "18",
"description": "Birthday father"
}
]
}
]
And here is the json I need:
[
{
"id":1,
"relatives_birthdays":[
{
"month": 8,
"day": 1,
"description": "Birthday mother"
},
{
"month": 3,
"day": 27,
"description": "Birthday brother"
},
{
"month": 4,
"day": 12,
"description": "Birthday father"
}
]
},
{
"id":2,
"relatives_birthdays":[
{
"month": 12,
"day": 11,
"description": "Birthday mother"
},
{
"month": 1,
"day": 2,
"description": "Birthday brother"
},
{
"month": 7,
"day": 18,
"description": "Birthday father"
}
]
}
]
Any ideas on the script I need to execute in order to accomplish this?