I have two jsons as follows
JSON 1 -
{
"2021-03-11": [
{
"14:30:00": 3000
}
],
"2021-03-14": [
{
"14:30:00": 130
}
]
}
JSON 2 -
{
"2021-03-02": [
{
"10:30:00": null
}
],
"2021-03-11": [
{
"10:30:00": null
},
{
"11:30:00": null
},
{
"14:30:00": null
}
],
"2021-03-12": [
{
"11:30:00": null
}
],
"2021-03-14": [
{
"14:30:00": null
}
],
"2021-03-15": [
{
"10:30:00": null
}
]
}
I want to combine these two JSON like below
{
"2021-03-02": [
{
"10:30:00": null
}
],
"2021-03-11": [
{
"10:30:00": null
},
{
"11:30:00": null
},
{
"14:30:00": 3000
}
],
"2021-03-12": [
{
"11:30:00": null
}
],
"2021-03-14": [
{
"14:30:00": 130
}
],
"2021-03-15": [
{
"10:30:00": null
}
]
}
But when I use the || operator, this is the result I get
{
{
"2021-03-02": [
{
"10:30:00": null
}
],
"2021-03-11": [
{
"14:30:00": 3000
}
],
"2021-03-12": [
{
"11:30:00": null
}
],
"2021-03-14": [
{
"14:30:00": 130
}
],
"2021-03-15": [
{
"10:30:00": null
}
]
}
for some reason it only retrieves only one second level key value pair, is there anyway to fix this?