How can i compare two Json document's and find the difference between them in Marklogic using javascript?
To compare 2 JSON Objects, you could just use The following function:
const areTheSame = (foo, bar) => JSON.stringify(foo) == JSON.stringify(bar);
// Example:
areTheSame({foo: 'bar'}, {foo: 'bar'}) // true
EDIT: As i mentionned, you cannot find the difference of 2 Objects... Good Luck!