Create examples for BSON

XMLWordPrintableJSON

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

      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
            Reporter:
            Alexander Golin (Inactive)
            None
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated: