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

Support reading a stream of BSON documents with Decoder

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • 2.0.0
    • Affects Version/s: None
    • Component/s: BSON
    • None
    • Not Needed
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?

      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.

            Assignee:
            qingyang.hu@mongodb.com Qingyang Hu
            Reporter:
            matt.dale@mongodb.com Matt Dale
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: