[COMPASS-7474] Investigate changes in NODE-5763: Remove number as an input to ObjectId constructor Created: 21/Nov/23  Updated: 29/Nov/23

Status: Waiting (Blocked)
Project: Compass
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Investigation Priority: Major - P3
Reporter: PM Bot Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: node-driver
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on NODE-5763 Remove number as an input to ObjectId... Backlog

 Description   

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

Generated at Wed Feb 07 22:46:40 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.