Rewrite compareDBObjects to match mongo 2.6 behavior.