Uploaded image for project: 'Compass '
  1. Compass
  2. COMPASS-6253

Investigate changes in NODE-3725: Constrain new ObjectId constructor and drop support for non-relevant cases

    • Type: Icon: Investigation Investigation
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • No version
    • Affects Version/s: None
    • Component/s: None
    • 0
    • Not Needed
    • Iteration Iguanodon

      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

            Assignee:
            Unassigned Unassigned
            Reporter:
            dbeng-pm-bot PM Bot
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: