Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-5763

Remove number as an input to ObjectId constructor

    • Type: Icon: Task Task
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: BSON
    • Needed

      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:
            Unassigned Unassigned
            Reporter:
            neal.beeken@mongodb.com Neal Beeken
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: