-
Type: Bug
-
Resolution: Fixed
-
Priority: Minor - P4
-
Affects Version/s: None
-
Component/s: BSON
What problem are you facing?
When creating a new `ObjectId`, if an array is provided as first parameter of the constructor, an error is not thrown, owever the resulting object doesn't have the `id` property. This means that every call to `toString()` will throw an error (equals, inspect, etc...)
What driver and relevant dependency versions are you using?
bson 4.5.3
Steps to reproduce?
// The following operation should throw an error const o = new require('bson').ObjectId([]); // Instead every subsequent operation on o will likely throw an error console.log(o);
- depends on
-
NODE-3663 Investigate NODE-3662 - Invoking ObjectID with an array generate a "broken" object
- Closed