-
Type: Bug
-
Resolution: Done
-
Priority: Trivial - P5
-
Affects Version/s: None
-
Component/s: None
What problem are you facing?
We've been migrating away from a custom `idEquals` function in a large codebase towards `ObjectId.equals`. Our custom function allowed for `undefined` ids and it looks like `.equals` allows for them as well when reading the function body, but the Typescript definition doesn't include `undefined` or `null` in the type union. This blocks the ability to pass a potentially undefined `ObjectId` to `.equals` and leads to awkward ternaries or other hacks that shouldn't be necessary from the caller.
What driver and relevant dependency versions are you using?
mongodb: 5.7.0