Class AggregationPipeline
java.lang.Object
org.restheart.mongodb.handlers.aggregation.AbstractAggregationOperation
org.restheart.mongodb.handlers.aggregation.AggregationPipeline
represents a map reduce.
- Author:
- Andrea Di Cesare <andrea@softinstigate.com>
-
Nested Class Summary
Nested classes/interfaces inherited from class org.restheart.mongodb.handlers.aggregation.AbstractAggregationOperation
AbstractAggregationOperation.TYPE -
Field Summary
FieldsFields inherited from class org.restheart.mongodb.handlers.aggregation.AbstractAggregationOperation
AGGREGATIONS_ELEMENT_NAME, TYPE_ELEMENT_NAME, URI_ELEMENT_NAME -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.bson.BsonBooleanList<org.bson.BsonDocument>getResolvedStagesAsList(org.bson.BsonDocument avars)org.bson.BsonArrayMethods inherited from class org.restheart.mongodb.handlers.aggregation.AbstractAggregationOperation
bindAggregationVariables, checkAggregationVariables, getFromJson, getType, getUri
-
Field Details
-
STAGES_ELEMENT_NAME
- See Also:
- Constant Field Values
-
ALLOW_DISK_USER_ELEMENT_NAME
- See Also:
- Constant Field Values
-
-
Constructor Details
-
AggregationPipeline
- Parameters:
properties- the json properties object. It must include the following properties:stages
Example:
aggrs: [ { "type":"pipeline", "uri":"test_ap", "allowDiskUse": false, "stages": [ {"_$match": { "name": { "_$exists": true}}}, {"_$group": { "_id": "$name", "avg_age": {"_$avg": "$age"} }} ] }]- Throws:
InvalidMetadataException
-
-
Method Details
-
getStages
public org.bson.BsonArray getStages()- Returns:
- the stages
-
getResolvedStagesAsList
public List<org.bson.BsonDocument> getResolvedStagesAsList(org.bson.BsonDocument avars) throws InvalidMetadataException, QueryVariableNotBoundException- Parameters:
avars- RequestContext.getAggregationVars()- Returns:
- the stages, with unescaped operators and bound variables
- Throws:
InvalidMetadataExceptionQueryVariableNotBoundException
-
getAllowDiskUse
public org.bson.BsonBoolean getAllowDiskUse()- Returns:
- the allowDiskUse
-