I am trying to run mongo db aggregate query from c#, but buffer size is exceeding 16MB. Is there any way to adjust the buffer size or any other workaround. I do not have the option to create collection in mongo server side and also I do not have any mongo utility like mongo.exe or mongoExport.exe in my client system.
You can set AllowDiskUse and OutputMode in AggregateArgs to allow more than 16 MB.
var mongoPipeline = new AggregateArgs { Pipeline = pipeline, AllowDiskUse = true, OutputMode = AggregateOutputMode.Cursor };
var response = Repository.Collection.Aggregate(mongoPipeline)
See MongoDB Reference for more informations.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With