Details
-
Improvement
-
Resolution: Unresolved
-
Unknown
-
None
-
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
Issue Links
- is related to
-
GODRIVER-2719 Remove unnecessary errors returned by "bson.Encoder" and "bson.Decoder" APIs
-
- Closed
-
- related to
-
GODRIVER-3024 Runtime Error 'index out of range' in MongoDB Go Driver ExtJSON Parsing
-
- Backlog
-
-
GODRIVER-3025 Create a peeking methodology for bson.Decode
-
- Backlog
-