I am using the official C # driver for MongoDB 2.2.3
How to set batch size for cursor using C # driver?
With javascript, I can create a cursor and set the batch size for it:
var cursor = db.statistics.find(query).batchSize(100)
and I can iterate over all elements using the following statement:
while(cursor.objsLeftInBatch()>0){
var doc = cursor.next();
}
I would like to have the same behavior in C # with async / await support. I know that I can use the cursor from C #, but the default packet size is 4 MB. This is too much like returning to a client with a single call.
source
share