-
Type: Task
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: BSON
-
Needed
Use Case
As a BSON user
I want the ObjectId constructor to either generate a new random Oid or make one from a full set of 12 bytes
So that the constructor creates ObjectIds from complete data
User Impact
- Numbers will no longer be supported in the constructor, users will need to migrate to createFromTime
Dependencies
- Driver
Unknowns
- None
Acceptance Criteria
Implementation Requirements
- Remove support for passing a number to the constructor
- Any non-nullish value should be type checked, any value not in the set of permitted values should cause an error to be thrown
- Permitted: 24 character hex strings, 12 length plain number arrays, 12 length Uint8Arrays, ObjectId, and ObjectIdLike
Testing Requirements
- Assert passing a number into the constructor throws
- Assert isValid returns false for number
Documentation Requirements
- Make sure API docs and Typescript are accurate
Follow Up Requirements
- None
- has to be done after
-
NODE-3034 Deprecate number as an input to ObjectId constructor
- Closed
- is depended on by
-
COMPASS-7474 Investigate changes in NODE-5763: Remove number as an input to ObjectId constructor
- Waiting (Blocked)