-
Type: Task
-
Resolution: Unresolved
-
Priority: Unknown
-
None
-
Affects Version/s: None
-
Component/s: None
Use Case
As a... user
I want... to only cache hex string if toHexString is called or a hex string is passed in the constructor
So that... performance is optimized
Unknowns
- Consider caching bytes and other properties in ObjectId lazily as well
Dependencies
- Generic deep equality checkers such as LODASH are no longer safe for users to use
Acceptance Criteria
Implementation Requirements
- When ObjectId.cacheHexString === true, lazily cache the hex string. This means only cache the hex string if:
- constructor is passed in a hex string
- objectid.toHexString() is called
- Make the ObjectId.__id property fully invisible to users by using the # keyword
Documentation Requirements
- Document that generic deep equality checkers are no longer safe to use with ObjectId, use the built-in equality checker for ObjectId instead
Follow Up Requirements
- N/A
- related to
-
NODE-6450 Lazily cache ObjectId hex string
- Closed