My validation process involves comparing individual rows in the clientDocument with the corresponding rows in the serverDocument, instead of comparing the entire documents at once. Currently, I am using the following code snippet for comparison:
JSON.stringify(clientDocument.scheduledLines) != JSON.stringify(serverDocument.scheduledLines)
Here are some data samples for better understanding:
// clientDocument: scheduledLines
[
{
_id: '6604',
resourceId: '5b482',
workOrderId: 'muoj'
},
{
_id: '9431',
resourceId: '9w214',
workOrderId: 'wocs'
}
]
// serverDocument: scheduledLines
[
{
_id: '6604',
resourceId: '5b482',
workOrderId: 'muoj'
},
{
_id: '9431',
resourceId: '9w214',
workOrderId: 'eiws'
}
]