Class StringBasedAggregation
java.lang.Object
org.springframework.data.mongodb.repository.query.AbstractMongoQuery
org.springframework.data.mongodb.repository.query.StringBasedAggregation
- All Implemented Interfaces:
org.springframework.data.repository.query.RepositoryQuery
AbstractMongoQuery
implementation to run string-based aggregations using
Aggregation
.- Since:
- 2.2
- Author:
- Christoph Strobl, Divya Srivastava, Mark Paluch
-
Constructor Summary
ConstructorDescriptionStringBasedAggregation
(MongoQueryMethod method, MongoOperations mongoOperations, org.springframework.expression.ExpressionParser expressionParser, org.springframework.data.repository.query.QueryMethodEvaluationContextProvider evaluationContextProvider) -
Method Summary
Modifier and TypeMethodDescriptionprotected Query
createQuery
(ConvertingParameterAccessor accessor) Creates aQuery
instance using the givenParameterAccessor
protected Object
doExecute
(MongoQueryMethod method, org.springframework.data.repository.query.ResultProcessor resultProcessor, ConvertingParameterAccessor accessor, Class<?> typeToRead) Execute theRepositoryQuery
of the given method with the parameters provided by theaccessor
protected boolean
Returns whether the query should get a count projection applied.protected boolean
Return weather the query should delete matching documents.protected boolean
Returns whether the query should get an exists projection applied.protected boolean
Return whether the query has an explicit limit set.Methods inherited from class org.springframework.data.mongodb.repository.query.AbstractMongoQuery
createCountQuery, createUpdate, decode, execute, getCodecRegistry, getParameterBindingCodec, getQueryMethod, getSpELExpressionEvaluatorFor, parseAggregationPipeline, prepareBindingContext
-
Constructor Details
-
StringBasedAggregation
public StringBasedAggregation(MongoQueryMethod method, MongoOperations mongoOperations, org.springframework.expression.ExpressionParser expressionParser, org.springframework.data.repository.query.QueryMethodEvaluationContextProvider evaluationContextProvider) - Parameters:
method
- must not be null.mongoOperations
- must not be null.expressionParser
- must not be null.evaluationContextProvider
- must not be null.
-
-
Method Details
-
doExecute
@Nullable protected Object doExecute(MongoQueryMethod method, org.springframework.data.repository.query.ResultProcessor resultProcessor, ConvertingParameterAccessor accessor, Class<?> typeToRead) Description copied from class:AbstractMongoQuery
Execute theRepositoryQuery
of the given method with the parameters provided by theaccessor
- Overrides:
doExecute
in classAbstractMongoQuery
- Parameters:
method
- theMongoQueryMethod
invoked. Never null.resultProcessor
-ResultProcessor
for post procession. Never null.accessor
- for providing invocation arguments. Never null.typeToRead
- the desired component target type. Can be null.
-
createQuery
Description copied from class:AbstractMongoQuery
Creates aQuery
instance using the givenParameterAccessor
- Specified by:
createQuery
in classAbstractMongoQuery
- Parameters:
accessor
- must not be null.- Returns:
-
isCountQuery
protected boolean isCountQuery()Description copied from class:AbstractMongoQuery
Returns whether the query should get a count projection applied.- Specified by:
isCountQuery
in classAbstractMongoQuery
- Returns:
-
isExistsQuery
protected boolean isExistsQuery()Description copied from class:AbstractMongoQuery
Returns whether the query should get an exists projection applied.- Specified by:
isExistsQuery
in classAbstractMongoQuery
- Returns:
-
isDeleteQuery
protected boolean isDeleteQuery()Description copied from class:AbstractMongoQuery
Return weather the query should delete matching documents.- Specified by:
isDeleteQuery
in classAbstractMongoQuery
- Returns:
-
isLimiting
protected boolean isLimiting()Description copied from class:AbstractMongoQuery
Return whether the query has an explicit limit set.- Specified by:
isLimiting
in classAbstractMongoQuery
- Returns:
-