I am using official C# driver for MongoDB 2.2.3
How can I set batch size for the cursor using the C# driver?
With javascript I can create a cursor and set batch size for it:
var cursor = db.statistics.find(query).batchSize(100)
and I can iterate through all items using the following statement:
while(cursor.objsLeftInBatch()>0){
var doc = cursor.next();
//process doc
}
I would like to have the same behaviour in C# with async/await support. I know that I can use cursor from C# but it's default batch size is 4MB. This is too match to return to the client with one call.