benjamine/jsondiffpatch

jsondiffpatch.diff gives undefined when comparing 2 different mongo ObjectIds

rohanricky opened this issue · 0 comments

Script to reproduce:

const mongoose = require('mongoose');
const jsondiffpatch = require('jsondiffpatch')

const id1 = new mongoose.Types.ObjectId()
const id2 = new mongoose.Types.ObjectId()

console.log(`jsondiffpatch ${id1} ${id2}`,jsondiffpatch.diff(id1, id2))

Output:
jsondiffpatch 65703f8fe4e276a1a653d00a 65703f8fe4e276a1a653d00b undefined

Expected: difference should be present

mongoose version: 6.12.3
jsondiffpatch version: 0.5.0