How can i set "<strong>allowDiskUse</strong>" option in aggregation method in spring data-mongodb framework ?
The core aggregation abstraction in Spring Data MongoDB is - as the name suggests -
Aggregation. It exposes a fluent API to build up a pipeline using aggregation operations.
As of version 1.6.0.M1 the
Aggregation class has a
….withOptions(…) method to be used like this:
Aggregation aggregation = newAggregation(…) // build up pipeline in here .withOptions(newAggregationOptions().allowDiskUse(true).build());
I found spring data-mongodb to have limited support for the aggregation framework, however you can simply use the native library leveraging spring mongo template:
on how to setup the
List<DBObject> pipeline and how to setup
allowDiskUse to true using the