-
Type: Task
-
Resolution: Done
-
Priority: Unknown
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
NODE-3662 Description
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);
- is depended on by
-
NODE-3662 Invoking ObjectID with an array generate a "broken" object
- Closed