-
Type: Investigation
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
0
-
Iteration Iguanodon
-
Not Needed
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
- depends on
-
NODE-3725 Constrain new ObjectId constructor and drop support for non-relevant cases
- Closed