[GODRIVER-2835] Support reading a stream of BSON documents with Decoder Created: 08/May/23  Updated: 08/Jan/24

Status: Backlog
Project: Go Driver
Component/s: BSON
Affects Version/s: None
Fix Version/s: 2.0.0

Type: Improvement Priority: Unknown
Reporter: Matt Dale Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to GODRIVER-3024 Runtime Error 'index out of range' in... Backlog
related to GODRIVER-3025 Create a peeking methodology for bson... Backlog
is related to GODRIVER-2719 Remove unnecessary errors returned by... Closed
Epic Link: Go Driver 2.0 BSON
Quarter: FY24Q3

 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.

Generated at Thu Feb 08 08:39:28 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.