Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to merge two json array using C++? #153

Open
DhanushQH opened this issue Apr 4, 2022 · 0 comments
Open

How to merge two json array using C++? #153

DhanushQH opened this issue Apr 4, 2022 · 0 comments

Comments

@DhanushQH
Copy link

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 :

  1. If Data exist, then update it and ignor duplicate data.
  2. If Data not exist added it into Reports array
    How can i write C++ code for this ?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant