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

Buffer inside object array empty

    • Type: Icon: Bug Bug
    • Resolution: Gone away
    • Priority: Icon: Unknown Unknown
    • None
    • Affects Version/s: 6.1.0
    • Component/s: js-bson
    • 2
    • Not Needed
    • Not Needed

      What problem are you facing?

      When presented with the payload below BSON.deserialize returns the wrong buffer value, payload.message as well as payload.attachments.[number].content are buffers, while payload.message returns the correct buffer for it, payload.attachments.[number].content on the other hand returns an empty buffer.

      {
        "type": "message",
        "payload": {
          "message": "rs3PxIMZiwoLZn0+Jcdvmg==",
          "attachments": [
            {
              "name": "My Facebook Page.txt",
              "content": "T+lvSaFiCnv5c6+wngbR5yYY9Tf9xviZPSB7q3R67IU8PWBO8ia7RlaiKoEn4nltvtOR6N8/ZFdhvm2Q3fKyq1kYlnWLJyzPvi5Oe72/CKanlmJCjjFTKwMaoDmD8ffffQEAYz24vaZQaF1T+YNCdwC6DCspUgPMxy3QAwK5SrmYBSpaQ91jwvDViWqH61JTQVRVLSdlAcKmxMiNivJ/wEikD7EO"
            }
          ]
        }
      }

       

      EJSON does return the correct items, I could move to EJSON but it does feel bad to lose all the advantages BSON de-serialization provides.

      What driver and relevant dependency versions are you using?

      I'm using 6.1.0

      Steps to reproduce?

      The payload is provided above, I simply use BSON.deserialize.

            Assignee:
            neal.beeken@mongodb.com Neal Beeken
            Reporter:
            WildEgo Luis Bizarro
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: