[GODRIVER-891] How to unmarshal from ReadCloser stream? Created: 21/Mar/19  Updated: 11/Sep/19  Resolved: 21/Mar/19

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

Type: Task Priority: Major - P3
Reporter: Mikołaj Hnatiuk Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

N/A



 Description   

I would want to pass io.ReadCloser object to some method in bson.Unmarshal*. I see a way to do it via using both bsonrw.NewExtJSONValueReader and bson.unmarshalFromReader but the second is unexported. Is it a bug or intended?



 Comments   
Comment by Mikołaj Hnatiuk [ 22/Mar/19 ]

Thanks, much appreciated

Comment by Ian Whalen (Inactive) [ 21/Mar/19 ]

Hey mhnatiuk, there's an API for this: look in the docs for NewFromIOReader and you'll have to call bson.Unmarshal with the result from that.

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