Say I got the following JSON:
{
users: [
{
qnt: "3",
post: "j8v2g5",
contact: "[email protected]",
id: "1"
},
{
qnt: "10",
post: "xxxyyy",
contact: "[email protected]",
id: "6"
},
{
qnt: "3",
post: "xxxyyy",
contact: "[email protected]",
id: "4"
}
]
}
I want all children of users with the same post to have their qnt added together and remove contact and id from the final result.
I want the result to look like this:
{
users: [
{
qnt: "3",
post: "j8v2g5"
},
{
qnt: "13",
post: "xxxyyy"
}
]
}