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
FieldsModifier and TypeFieldDescriptionstatic final Stringthe allowDiskUse property namestatic final Stringthe stages property nameFields inherited from class org.restheart.mongodb.handlers.aggregation.AbstractAggregationOperation
AGGREGATIONS_ELEMENT_NAME, TYPE_ELEMENT_NAME, URI_ELEMENT_NAME -
Constructor Summary
ConstructorsConstructorDescriptionAggregationPipeline(org.bson.BsonDocument properties) Constructor from aggregation definition in collection metadata -
Method Summary
Modifier and TypeMethodDescriptionorg.bson.BsonBooleanList<org.bson.BsonDocument>getResolvedStagesAsList(org.bson.BsonDocument avars) org.bson.BsonArrayorg.bson.BsonArrayremoveOptionalNotBoundStages(org.bson.BsonDocument avars) Methods inherited from class org.restheart.mongodb.handlers.aggregation.AbstractAggregationOperation
bindAggregationVariables, checkAggregationVariables, getFromJson, getType, getUri
-
Field Details
-
STAGES_ELEMENT_NAME
the stages property name- See Also:
-
ALLOW_DISK_USER_ELEMENT_NAME
the allowDiskUse property name- See Also:
-
-
Constructor Details
-
AggregationPipeline
Constructor from aggregation definition in collection metadata- Parameters:
properties- the json object defining the aggregation; it must include the arraystages. Note: dollar prefixed operators in the stages must be underscore escaped, e.g. "_$exits". Example:{ "type": "pipeline", "uri": "test_ap", "allowDiskUse": false, "stages": [ { "_$match": { "name": { "_$exists": true } } } ] }- Throws:
InvalidMetadataException
-
-
Method Details
-
getStages
public org.bson.BsonArray getStages()- Returns:
- the stages
-
removeOptionalNotBoundStages
public org.bson.BsonArray removeOptionalNotBoundStages(org.bson.BsonDocument avars) -
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
-