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

Create examples for BSON

    • Type: Icon: Task Task
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: BSON

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

      The API is extremely unclear. Are there better docs anywhere? Or examples? The unit tests aren't very useful as examples.

      E.g. how do you use the binary type? Looks like with ``new Binary(array)``, but then what? This, for example, doesn't work:

      bson.serialize({foo: new bson.Binary(new Uint8Array(10))})
      

      and throws

        data.copy(buffer, index, 0, value.position);
             ^
      
      TypeError: data.copy is not a function
      

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

              Created:
              Updated: