Remove number as an input to ObjectId constructor

XMLWordPrintableJSON

    • 2
    • Needed
    • 🔵 Done
    • Not Needed
    • None
    • None
    • None
    • None
    • None
    • None

      Use Case

      As a BSON user
      I want the ObjectId constructor to either generate a new random Oid or make one from a full set of 12 bytes
      So that the constructor creates ObjectIds from complete data

      User Impact

      • Numbers will no longer be supported in the constructor, users will need to migrate to createFromTime

      Dependencies

      • Driver

      Unknowns

      • None

      Acceptance Criteria

      Implementation Requirements

      • Remove support for passing a number to the constructor
      • Any non-nullish value should be type checked, any value not in the set of permitted values should cause an error to be thrown
        • Permitted: 24 character hex strings, 12 length plain number arrays, 12 length Uint8Arrays, ObjectId, and ObjectIdLike

      Testing Requirements

      • Assert passing a number into the constructor throws
      • Assert isValid returns false for number

      Documentation Requirements

      • Make sure API docs and Typescript are accurate

      Follow Up Requirements

      • None

            Assignee:
            Bailey Pearson
            Reporter:
            Neal Beeken
            Daria Pardue
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: