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

Deprecate number as an input to ObjectId constructor

    • 2
    • 0
    • Not Needed
    • Not Needed
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?

       

      Use Case

      As a BSON user
      I want the ObjectId constructor to accept values that represent complete ObjectIds
      So that I either generate a new Oid or build from an existing one

      User Impact

      • Using numbers in the ObjectId constructor will have a deprecated tag.
        • In editors that support it, the API should appear as new ObjectId(2)

      Dependencies

      • The driver by re-exporting ObjectId should also make this documentation available to users

      Unknowns

      • None

      Acceptance Criteria

      Implementation Requirements

      • Separate the current accepted ObjectId constructor input types into individual typescript overrides
      • Mark the one that accepts number as deprecated
        • Mention the preferred createFromTime helper
      • Update isValid documentation to mention the deprecation

      Testing Requirements

      • Add a type test for the deprecation

      Documentation Requirements

      • Ensure change is merged as a feat and release notes capture the planned change

      Follow Up Requirements

            Assignee:
            alena.khineika@mongodb.com Alena Khineika
            Reporter:
            alexander.golin@mongodb.com Alexander Golin (Inactive)
            Neal Beeken
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: