-
Type:
Task
-
Resolution: Unresolved
-
Priority:
Unknown
-
None
-
Affects Version/s: None
-
Component/s: BSON
-
None
-
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 inNODE-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.
- depends on
-
NODE-7627 Remove ObjectId.cacheHexString
-
- Needs Triage
-
- related to
-
NODE-5224 Deprecate cacheHexString on UUID class
-
- Closed
-
-
NODE-7625 ObjectId.toHexString() returns non-lowercase under cacheHexString when constructed from an uppercase hex string
-
- Needs Triage
-
-
NODE-6246 ObjectIds stored as Buffer in memory are memory inefficient and slow
-
- Backlog
-
-
NODE-6450 Lazily cache ObjectId hex string
-
- Closed
-
-
NODE-6480 Lazily cache ObjectId hex string by default
-
- Closed
-