Deprecate ObjectId.cacheHexString

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Unresolved
    • Priority: Unknown
    • None
    • Affects Version/s: None
    • Component/s: BSON
    • None
    • 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?
    • None
    • None
    • None
    • None
    • None
    • None

      Deprecate the static ObjectId.cacheHexString opt-in flag, with removal planned for the next major version.

      Rationale:

      • ObjectId.cacheHexString is opt-in and undefined by default. It cannot simply be enabled by default: caching per-instance hex state breaks deep clone (when stored as a #private field, reverted in NODE-7271) or deep equality (when stored as a visible property). Default-on was rejected in NODE-6480 (Won't Do).
      • The packed-integer ObjectId representation (NODE-6246) makes toHexString() cheap, so even the opt-in cache buys little now.
      • When enabled, the flag caches the raw (possibly uppercase) input, see NODE-7625.
      • Precedent: the equivalent flag on the UUID class was deprecated in NODE-5224.

      Scope: add an @deprecated tag to ObjectId.cacheHexString, note it in the docs and changelog, and schedule removal for the next major. Once removed, NODE-7625 becomes moot.

      This is standalone deprecation/cleanup work and does not belong inside any feature ticket.

            Assignee:
            Unassigned
            Reporter:
            Sergey Zelenov
            None
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: