Uploaded image for project: 'Go Driver'
  1. Go Driver
  2. GODRIVER-2835

Support reading a stream of BSON documents with Decoder

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Unknown Unknown
    • 2.0.0
    • None
    • BSON
    • None

    Description

      Currently it's not practical to read a stream of BSON documents (sometimes called a "document sequence") using a bson.Decoder. However, it is possible to write a stream of BSON documents using bson.Encoder, so Decoder should support the inverse functionality.

      Definition of done:

      • Change the bson.NewBSONDocumentReader (renamed to NewValueReader) input to an io.Reader instead of []byte.
      • Make sure the stream reading behavior works with Extended JSON as well.
      • (Optional) Consider following the pattern of the Go JSON decoder More function.
      • Update the internal valueReader type to support reading a stream of documents instead of just one.
      • Add an example of how to read a stream of documents.

      Attachments

        Activity

          People

            Unassigned Unassigned
            matt.dale@mongodb.com Matt Dale
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: