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

Incorrect binary data EJSON.stringify

      https://github.com/mongodb/js-bson/issues/331

      Basically I wanted to stringify the binary data but doing so results in an invalid one.

      Suppose EJSON is imported;

      function getEJSONString(data) {
        return EJSON.stringify(data);
      }
      

      That gives me wrong binary format and whenever I imported it in another database of MongoDB, the files is nowhere to be found.

      I manage to do it using old library, but tried several things using the current library like using serialize, deserialize or combination of both, but still the the problem persists.

      Using mongodb-extended-json library solves the problem.

      function getJSONString(data) {
        return EJSON.stringify(ejson.serialize(data));
      }
      

      Still this is an outdated library and it would be better if this can be solve using the current one.

      Where did I go wrong here?

            Assignee:
            Unassigned Unassigned
            Reporter:
            alexander.golin@mongodb.com Alexander Golin (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: