Class AggregationPipeline
- java.lang.Object
-
- org.restheart.mongodb.handlers.aggregation.AbstractAggregationOperation
-
- org.restheart.mongodb.handlers.aggregation.AggregationPipeline
-
public class AggregationPipeline extends AbstractAggregationOperation
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
Fields Modifier and Type Field Description static StringALLOW_DISK_USER_ELEMENT_NAMEstatic StringSTAGES_ELEMENT_NAME-
Fields inherited from class org.restheart.mongodb.handlers.aggregation.AbstractAggregationOperation
AGGREGATIONS_ELEMENT_NAME, TYPE_ELEMENT_NAME, URI_ELEMENT_NAME
-
-
Constructor Summary
Constructors Constructor Description AggregationPipeline(org.bson.BsonDocument properties)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.bson.BsonBooleangetAllowDiskUse()List<org.bson.BsonDocument>getResolvedStagesAsList(org.bson.BsonDocument avars)org.bson.BsonArraygetStages()-
Methods inherited from class org.restheart.mongodb.handlers.aggregation.AbstractAggregationOperation
bindAggregationVariables, checkAggregationVariables, getFromJson, getType, getUri
-
-
-
-
Field Detail
-
STAGES_ELEMENT_NAME
public static final String STAGES_ELEMENT_NAME
- See Also:
- Constant Field Values
-
ALLOW_DISK_USER_ELEMENT_NAME
public static final String ALLOW_DISK_USER_ELEMENT_NAME
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AggregationPipeline
public AggregationPipeline(org.bson.BsonDocument properties) throws InvalidMetadataException- 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 Detail
-
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:
InvalidMetadataExceptionorg.restheart.mongodb.handlers.aggregation.QueryVariableNotBoundExceptionQueryVariableNotBoundException
-
getAllowDiskUse
public org.bson.BsonBoolean getAllowDiskUse()
- Returns:
- the allowDiskUse
-
-