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

    XMLWordPrintableJSON

Details

    • Icon: Investigation Investigation
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • No version
    • None
    • None
    • 0
    • Not Needed
    • 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

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: