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

Document when using the raw option buffers returned are backed by shared pool

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • 4.12.0
    • Affects Version/s: None
    • Component/s: None
    • 1
    • Not Needed
    • Not Needed

      Summary

      When using the raw flag the Uint8Arrays returned are backed by nodejs' pooled buffer, if the buffer's lifetime is beyond that of passing it along to some sort of serialization this could have unexpected consequences. It should be documented at least, or possible changed by the raw configuration.

      Ref: https://nodejs.org/dist/latest-v16.x/docs/api/buffer.html#static-method-bufferallocunsafeslowsize

      AC

      • We should document this behavior on the raw flag

            Assignee:
            neal.beeken@mongodb.com Neal Beeken
            Reporter:
            neal.beeken@mongodb.com Neal Beeken
            Durran Jordan
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: