I would like to compare data returned from 2 different nodes and only get the data that is different.
What I’m trying to do is a type of update history which in this case would only show what data was changed.
Data 1
[
{
"body": {
"Dados antigo": {
"numero-cadastro": 1302,
"id-pedido": 5402268137,
"status-pedido": "delivered / paid",
"nick-comprador": "VIMA7523370"
}
}
}
]
Data 2
[
{
"body": {
"Dados novos": {
"numero-cadastro": 1302,
"id-pedido": 5402268137,
"status-pedido": "finished",
"nick-comprador": "VIMA7523370"
}
}
}
]
in this example the only item that changed between Data 1 and Data 2 was (“order-status”: “delivered / paid”) which changed to (“order-status”: “finished”)
what I’m trying is some function that just indicates the item that was changed.
The changed data I need would be Data 2 which would be the current data.
In the example above the correct would be to return the Data 2-order": "finished "
I tried in several ways but I couldn’t make it work, could you help me?