I’m trying to stream a large byte array into a new collection in MongoDb, but I don’t see any methods that accept a stream. Is there a way to do this?
Posted the details of my question on stack overflow here.
I’m trying to stream a large byte array into a new collection in MongoDb, but I don’t see any methods that accept a stream. Is there a way to do this?
Posted the details of my question on stack overflow here.
solved on the SO question
while (stream.Position < stream.Length)
{
var rawBson = BsonSerializer.Deserialize<RawBsonDocument>(stream);
await rawRef.InsertOneAsync(rawBson);
}