Class AggregationResults<T>
java.lang.Object
org.springframework.data.mongodb.core.aggregation.AggregationResults<T>
- Type Parameters:
T- The class in which the results are mapped onto.
- All Implemented Interfaces:
Iterable<T>
-
Constructor Summary
ConstructorsConstructorDescriptionAggregationResults(List<T> mappedResults, org.bson.Document rawResults) Creates a newAggregationResultsinstance from the given mapped and raw results. -
Method Summary
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Iterable
forEach, spliterator
-
Constructor Details
-
AggregationResults
Creates a newAggregationResultsinstance from the given mapped and raw results.- Parameters:
mappedResults- must not be null.rawResults- must not be null.
-
-
Method Details
-
getMappedResults
-
getUniqueMappedResult
Returns the unique mapped result. Assumes no result or exactly one.- Returns:
- the single already mapped result object or raise an error if more than one found.
- Throws:
IllegalArgumentException- in case more than one result is available.
-
iterator
-
getServerUsed
Returns the server that has been used to perform the aggregation.- Returns:
- can be null.
-
getRawResults
public org.bson.Document getRawResults()Returns the raw result that was returned by the server.- Returns:
- the raw response.
- Since:
- 1.6
-