[COMPASS-6253] Investigate changes in NODE-3725: Constrain new ObjectId constructor and drop support for non-relevant cases Created: 26/Oct/22  Updated: 21/Aug/23  Resolved: 21/Aug/23

Status: Closed
Project: Compass
Component/s: None
Affects Version/s: None
Fix Version/s: No version

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

Issue Links:
Depends
depends on NODE-3725 Constrain new ObjectId constructor an... Closed
Epic Link: MONGOSH-1319
Story Points: 0
Documentation Changes: Not Needed
Sprint: Iteration Iguanodon

 Description   

What problem are you facing?

Right now the ObjectID constructor accepts parameters of the following types: string,  Buffer, number, ObjectIdLike, ObjectId. We could constrain the new constructor to specific types (it should definitely accept hex string, buffer, no args, and potentially ObjectID, but we could drop support for 12 byte strings and numbers) and add static ObjectId.from for the other cases. 
 

Acceptance Criteria 

  • Fix the constructor to support specific types 
  • Add tests to ensure that constructor is handling unsupported cases appropriately


 Comments   
Comment by Anna Henningsen [ 21/Aug/23 ]

No impact after all.

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