jsondiff in MongoDB

jsondiff is the semantic JSON compare tool to Validate, format, and compare two JSON documents. I need to develop the jsondiff functionality using javascript to compare two document and produce the report with differences of attributes, and differences in data structure and its difference of data type. The collection contains array of objects. Need to customize the javascript for in-depth comparison. Thanks.