How to merge two json array using C++?
DhanushQH opened this issue · 0 comments
DhanushQH commented
I want to merge given JSON object into existing JSON object using C++.
My JSON object contains Array elements
This is my existing JSON object :
{
"FeatureReports": {
"ProductInformation": {
"ProductName": "E_Portal"
},
"Reports": [
{
"user_purchase": [
{
"sr_no": 1,
"ItemName": "TV"
},
{
"sr_no": 2,
"ItemName": "AC"
}
]
},
{
"User_Sell": [
{
"sr_no": 1,
"ItemName": "Refrigerator"
}
]
}
]
}
}
Now, I want to add/update user_purchase array elements.
Steps need to check :
- If Data exist, then update it and ignor duplicate data.
- If Data not exist added it into Reports array
How can i write C++ code for this ?