Uit de documenten.
U kunt batchSize
doorgeven met AggregationOptions
in Spring Mongo 2.x-versie
Aggregation aggregation = newAggregation(unwind, group).withOptions(newAggregationOptions().cursorBatchSize(100).build());
Met standaard batchgrootte
Aggregation aggregation = newAggregation(unwind, group).withOptions(newAggregationOptions().cursor(new Document()).build());