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

Remove promoteBuffers from Monitor's BSON settings

    • 2
    • 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 Node.js engineer
      I want a consistent experience with types returned from the server 
      So that logging and event monitoring is clear and accurate

      The Monitor is configured to promoteBuffers, a setting that will change Binary types to Node.js Buffers. This makes the subtype inaccessible and degrades the log-ability and readability of the value. 

      Mainly, this fixes a logging inconvenience, our hellos are longer than 1000 characters because we are hitting Buffer.prototype.toJSON instead of Binary’s extended JSON format

      User Impact

      • Depends on our opinion on the reply field of the serverHeartBeat event and how it relates to semver. Technically this field changes depending on the server version/topology you connect to.

      Dependencies

      • The "signature.hash" field

      Unknowns

      • Is there any code that depends on this change? The main focus is to make signature.hash a Binary again so that it will inspect as a base64 string. Are there other Binary fields the monitor may receive? Is there any reason they should not be Binary?

      Acceptance Criteria

      Implementation Requirements

      • set promoteBuffers to false in monitor constructor
        • The "signature.hash" field should be a Binary

      Testing Requirements

      • assert the Monitor calls command with promoteBuffers set to false
      • Manually verify that signature.hash is a Binary

      Documentation Requirements

      • API documentation on server reply fields and semver

      Follow Up Requirements

      • None

            Assignee:
            bailey.pearson@mongodb.com Bailey Pearson
            Reporter:
            neal.beeken@mongodb.com Neal Beeken
            Warren James
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: