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

Lazily cache ObjectId hex string

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

      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

            Assignee:
            Unassigned Unassigned
            Reporter:
            aditi.khare@mongodb.com Aditi Khare
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: