-
Type: Task
-
Resolution: Won't Do
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: BSON
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
- is depended on by
-
COMPASS-6253 Investigate changes in NODE-3725: Constrain new ObjectId constructor and drop support for non-relevant cases
- Closed