ObjecId instances are objects and so are compared like objects, not primitives.You should use either
ObjecId
post._id.equals(object._id)
or
post._id.toString() === object._id.toString()