Compare items and remove identical ones, keeping only different ones

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?

Hi @Rodrigo_Barbosa

Is the data already in the correct order? I mean for all data not just this example?
If not, is there any date or something like that to order it by?

What is needed is a loop in which you check if the id/number already exists and not include it if it does.
In this case you would reverse the array and then loop through only keeping the first record of that id/number.
If you can answer my questions, I can create a function for you to do this. (if no one else already did)

Edit: the Item node has an option to remove the duplicates. And it can also reorder the data for you. Have you had a look at it?