Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MongoDb aggregation 16MB buffer size limit

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.

like image 402
diptarana mitra Avatar asked Jan 28 '26 01:01

diptarana mitra


1 Answers

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.

like image 75
take Avatar answered Jan 29 '26 14:01

take



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!