Package org.springframework.data.mongodb.core.aggregation
@NonNullApi
package org.springframework.data.mongodb.core.aggregation
Support for the MongoDB aggregation framework.
- Since:
- 1.3
-
ClassDescriptionGateway to accumulator aggregation operations.
AggregationExpression
for$avg
.AggregationExpression
for$covariancePop
.AggregationExpression
for$covarianceSamp
.AccumulatorOperators.ExpMovingAvg
calculates the exponential moving average of numeric values.Builder forAccumulatorOperators.ExpMovingAvg
.AggregationExpression
for$max
.AggregationExpression
for$min
.AggregationExpression
for$stdDevPop
.AggregationExpression
for$stdDevSamp
.AggregationExpression
for$sum
.Adds new fields to documents.AnAggregation
is a representation of a list of aggregation steps to be performed by the MongoDB Aggregation Framework.AnAggregationExpression
can be used with field expressions in aggregation pipeline stages likeproject
andgroup
.Represents one single operation in an aggregation pipeline.The context for anAggregationOperation
.Holds a set of configurable aggregation options that can be used within an aggregation pipeline.A Builder forAggregationOptions
.Aggregation pipeline Domain type mappings supported by the mapping layer.TheAggregationPipeline
holds the collection ofaggregation stages
.Collects the results of executing an aggregation operation.AnAggregationExpression
that renders a MongoDB Aggregation Framework expression from the AST of a SpEL expression.Abstraction fordb.collection.update()
using an aggregation pipeline.Fluent API AggregationUpdate builder.Gateway to Arithmetic aggregation operations that perform math operations on numbers.AggregationExpression
for$abs
.Anexpression
that calculates the inverse cosine of a value.Anexpression
that calculates the inverse hyperbolic cosine of a value.AggregationExpression
for$add
.The unit of measure for computations that operate upon angles.Anexpression
that calculates the inverse sine of a value.Anexpression
that calculates the inverse hyperbolic sine of a valueAnexpression
that calculates the inverse tangent of a value.Anexpression
that calculates the inverse tangent of y / x, where y and x are the first and second values passed to the expression respectively.Anexpression
that calculates the inverse hyperbolic tangent of a valueAggregationExpression
for$ceil
.Anexpression
that calculates the cosine of a value that is measured in radians.Anexpression
that calculates the hyperbolic cosine of a value that is measured inArithmeticOperators.AngularUnit.RADIANS
.Value object to represent anexpression
that calculates the average rate of change within the specified window.AggregationExpression
for$divide
.AggregationExpression
for$exp
.AggregationExpression
for$floor
.Value object to represent anexpression
that calculates the approximation for the mathematical integral value.AggregationExpression
for$ln
.AggregationExpression
for$log
.AggregationExpression
for$log10
.AggregationExpression
for$mod
.AggregationExpression
for$multiply
.AggregationExpression
for$pow
.ArithmeticOperators.Rand
returns a floating value between 0 and 1.ArithmeticOperators.Round
rounds a number to a whole integer or to a specified decimal place.Anexpression
that calculates the sine of a value that is measured in radians.Anexpression
that calculates the hyperbolic sine of a value that is measured inArithmeticOperators.AngularUnit.RADIANS
.AggregationExpression
for$sqrt
.AggregationExpression
for$subtract
.Anexpression
that calculates the tangent of a value that is measured in radians.Anexpression
that calculates the hyperbolic tangent of a value that is measured inArithmeticOperators.AngularUnit.RADIANS
.AggregationExpression
for$trunc
.Gateway to array aggregation operations.AggregationExpression
for$arrayElementAt
.AggregationExpression
for$arrayToObject
that transforms an array into a single document.AggregationExpression
for$concatArrays
.$filter
AggregationExpression
allows to select a subset of the array to return based on the specified condition.AggregationExpression
for$first
that returns the first element in an array.AggregationExpression
for$in
.AggregationExpression
for$indexOfArray
.AggregationExpression
for$isArray
.AggregationExpression
for$last
that returns the last element in an array.AggregationExpression
for$range
.AggregationExpression
for$reduce
.AggregationExpression
for$reverseArray
.AggregationExpression
for$size
.AggregationExpression
for$slice
.AggregationExpression
for$sortArray
that sorts elements in an array.AggregationExpression
for$zip
.Gateway to boolean expressions that evaluate their argument expressions as booleans and return a boolean as the result.AggregationExpression
for$and
.AggregationExpression
for$not
.AggregationExpression
for$or
.Encapsulates the aggregation framework$bucketAuto
-operation.BucketOperationSupport.OutputBuilder
implementation forBucketAutoOperation
.BucketOperationSupport.ExpressionBucketOperationBuilderSupport
implementation forBucketAutoOperation
using SpEL expression basedBucketOperationSupport.Output
.Supported MongoDB granularities.Encapsulates the aggregation framework$bucket
-operation.BucketOperationSupport.OutputBuilder
implementation forBucketOperation
.BucketOperationSupport.ExpressionBucketOperationBuilderSupport
implementation forBucketOperation
using SpEL expression basedBucketOperationSupport.Output
.BucketOperationSupport<T extends BucketOperationSupport<T,B>, B extends BucketOperationSupport.OutputBuilder<B, T>> Base class for bucket operations that support output expressions the aggregation framework.BucketOperationSupport.ExpressionBucketOperationBuilderSupport<B extends BucketOperationSupport.OutputBuilder<B,T>, T extends BucketOperationSupport<T, B>> Builder for SpEL expression-basedBucketOperationSupport.Output
.Output field that uses a Mongo operation (expression object) to generate an output field value.Encapsulates an output field in a bucket aggregation stage.BucketOperationSupport.OutputBuilder<B extends BucketOperationSupport.OutputBuilder<B,T>, T extends BucketOperationSupport<T, B>> Base class forBucketOperationSupport.Output
builders that result in aBucketOperationSupport
providing the builtBucketOperationSupport.Output
.EncapsulatesBucketOperationSupport.Output
s.Gateway to comparison expressions.AggregationExpression
for$cmp
.AggregationExpression
for$eq
.AggregationExpression
for$gt
.AggregationExpression
for$gte
.AggregationExpression
for$lt
.AggregationExpression
for$lte
.AggregationExpression
for$ne
.Gateway to conditional expressions that evaluate their argument expressions as booleans to a value.Encapsulates the aggregation framework$cond
operator.Encapsulates the aggregation framework$ifNull
operator.AggregationExpression
for$switch
.Encapsulates the aggregation framework case document inside a$switch
-operation.Gateway to convert aggregation operations.AggregationExpression
for$convert
that converts a value to a specified type.AggregationExpression
for$degreesToRadians
that converts an input value measured in degrees to radians.AggregationExpression
for$toBool
that converts a value to boolean.AggregationExpression
for$toDate
that converts a value to date.AggregationExpression
for$toDecimal
that converts a value to decimal.AggregationExpression
for$toDouble
that converts a value to double.AggregationExpression
for$toInt
that converts a value to integer.AggregationExpression
for$toLong
that converts a value to long.AggregationExpression
for$toObjectId
that converts a value to objectId.AggregationExpression
for$toString
that converts a value to string.Encapsulates the aggregation framework$count
-operation.Builder forCountOperation
.Gateway to data type expressions.AggregationExpression
for$type
.Gateway to Date aggregation operations.DateOperators.DateParts<T extends DateOperators.DateParts<T>>AggregationExpression
for$dateToString
.AggregationExpression
for$dayOfMonth
.AggregationExpression
for$dayOfWeek
.AggregationExpression
for$dayOfYear
.AggregationExpression
for$hour
.AggregationExpression
for$isoDayOfWeek
.AggregationExpression
for$isoWeek
.AggregationExpression
for$isoWeekYear
.AggregationExpression
for$millisecond
.AggregationExpression
for$minute
.AggregationExpression
for$month
.AggregationExpression
for$second
.Interface defining a temporal unit for date operators.Timezone represents a MongoDB timezone abstraction which can be represented with a timezone ID or offset as aString
.AggregationExpression
capable of setting a givenDateOperators.Timezone
.AggregationExpression
for$tsIncrement
.AggregationExpression
for$tsSecond
.AggregationExpression
for$week
.AggregationExpression
for$year
.Encapsulates the aggregation framework$densify
-operation.DensifyOperation.Range
implementation holding lower and upper bound values.BaseDensifyOperation.Range
implementation.The actual time unit to apply to aDensifyOperation.Range
.Quick access to availableunits
.TheDensifyOperation.Range
specifies how the data is densified.Gateway to document expressions such as $rank, $documentNumber, etc.DocumentOperators.DenseRank
resolves the current document position (the rank) relative to other documents.DocumentOperators.DocumentNumber
resolves the current document position.DocumentOperators.Rank
resolves the current document position (the rank) relative to other documents.Shift applies an expression to a document in a specified position relative to the current document.Gateway to evaluation operators such as $expr.Allows the use of aggregation expressions within the query language.Sets null and missing values to the last non-null value.Value object to capture the fields exposed by anAggregationOperation
.A reference to anExposedFields.ExposedField
.Encapsulates the aggregation framework$facet
-operation.Builder forFacetOperation
by adding existing and the new pipeline ofAggregationOperation
to the newFacetOperation
.Abstraction for a field.Value object to capture a list ofField
instances.AggregationOperation
that exposesExposedFields
that can be used for later aggregation pipelineAggregationOperation
s.Marker interface forAggregationOperation
that inherits fields from previous operations.Represents ageoNear
aggregation operation.Encapsulates the aggregation framework$graphLookup
-operation.Encapsulates the aggregation framework$group
-operation.Builder forGroupOperation
s on a field.Encapsulates the$limit
-operation.Gateway to literal aggregation operations.AggregationExpression
for$literal
.Encapsulates the aggregation framework$lookup
-operation.Builder for fluentLookupOperation
creation.Encapsulates the$match
-operation.Encapsulates the$merge
-operation.Builder API to construct aMergeOperation
.Value Object representing theinto
field of a$merge
aggregation stage.Value object representing the unique id used during the merge operation to identify duplicates in the target collection.Value Object specifying how to deal with a result document that do not match an existing document in the collection based on the fields of theon
property describing the unique identifier.Value Object specifying how to deal with a result document that matches an existing document in the collection based on the fields of theon
property describing the unique identifier.Gateway for object expression operators.AggregationExpression
for$getField
.AggregationExpression
for$mergeObjects
that combines multiple documents into a single document.AggregationExpression
for$objectToArray
that converts a document to an array ofdocuments
that each contains two fields k and v.AggregationExpression
for$setField
.Encapsulates the$out
-operation.The mode for merging the aggregation pipeline output.AggregationOperationContext
implementation prefixing non-command keys on root level with the given prefix.Encapsulates the aggregation framework$project
-operation.Builder forarray
projections.AnProjectionOperation.ProjectionOperationBuilder
that is used for SpEL expression based projections.Builder forProjectionOperation
s on a field.RedactOperation
allows to restrict the content of aDocument
based on information stored within itself.Builder to create new instance ofRedactOperation
.ATypeBasedAggregationOperationContext
with less restrictive field reference handling, suppressingInvalidPersistentPropertyPath
exceptions when resolving mapped field names.Encapsulates the aggregation framework$replaceRoot
-operation.Replacement object that results in a replacement document or an expression that results in a document.Encapsulates the aggregation framework$replaceRoot
-operation to result in a composable replacement document.Builder forReplaceRootOperation.ReplaceRootDocumentOperation
to populateReplaceRootOperation.ReplacementDocument
Builder forReplaceRootOperation
.Encapsulates the aggregation framework$replaceRoot
-operation.Encapsulates the$sample
-operation.Gateway to $function and $accumulator aggregation operations.ScriptOperators.Accumulator
defines a custom aggregation $accumulator operator, one that maintains its state (e.g. totals, maximums, minimums, and related data) as documents progress through the pipeline, in JavaScript.ScriptOperators.Function
defines a custom aggregation $function in JavaScript.Gateway to selection operators such as $bottom.AbstractAggregationExpression
to return the bottom element according to the specifiedorder
.AbstractAggregationExpression
to return the $firstN elements.AbstractAggregationExpression
to return the $lastN elements.AbstractAggregationExpression
to return the top element according to the specifiedorder
.Adds new fields to documents.Gateway to Set expressions which perform set operation on arrays, treating arrays as sets.AggregationExpression
for$allElementsTrue
.AggregationExpression
for$anyElementTrue
.AggregationExpression
for$setDifference
.AggregationExpression
for$setEquals
.AggregationExpression
for$setIntersection
.AggregationExpression
for$setIsSubset
.AggregationExpression
for$setUnion
.Encapsulates thesetWindowFields
-operation.AField
that the result of a computation done via anAggregationExpression
.SetWindowFieldsOperation.Window
implementation based on the current document.Builder API for aSetWindowFieldsOperation.RangeWindow
.SetWindowFieldsOperation.Window
implementation based on the sort fields.Builder API for aSetWindowFieldsOperation.RangeWindow
.A fluent builder to create aSetWindowFieldsOperation
.Interface to capture field name used to capture the computation result.Interface to capture an optionalSetWindowFieldsOperation.Window
applicable to the field computation.ASetWindowFieldsOperation.Window
to be used forComputedField
.SetWindowFieldsOperation.WindowOutput
defines output of $setWindowFields stage by defining thefield(s)
to append to the documents in the output.The actual time unit to apply to aSetWindowFieldsOperation.Window
.Quick access to availableunits
.Encapsulates the aggregation framework$skip
-operation.Encapsulates the aggregation framework$sortByCount
-operation.Encapsulates the aggregation framework$sort
-operation.Gateway to String aggregation operations.AggregationExpression
for$concat
.AggregationExpression
for$indexOfBytes
.AggregationExpression
for$indexOfCP
.AggregationExpression
for$ltrim
which removes whitespace or the specified characters from the beginning of a string.AggregationExpression
for$regexFind
which applies a regular expression (regex) to a string and returns information on the first matched substring.AggregationExpression
for$regexFindAll
which applies a regular expression (regex) to a string and returns information on all the matched substrings.AggregationExpression
for$regexMatch
which applies a regular expression (regex) to a string and returns a boolean that indicates if a match is found or not.AggregationExpression
for$replaceAll
which replaces all instances of a search string in an input string with a replacement string.AggregationExpression
for$replaceOne
which replaces the first instance of a search string in an input string with a replacement string.AggregationExpression
for$rtrim
which removes whitespace or the specified characters from the end of a string.AggregationExpression
for$split
.AggregationExpression
for$strcasecmp
.AggregationExpression
for$strLenBytes
.AggregationExpression
for$strLenCP
.AggregationExpression
for$substr
.AggregationExpression
for$substrCP
.AggregationExpression
for$toLower
.AggregationExpression
for$toUpper
.AggregationExpression
for$trim
which removes whitespace or the specified characters from the beginning and end of a string.Describes the system variables available in MongoDB aggregation framework pipeline expressions.AggregationOperationContext
aware of a particular type and aMappingContext
to potentially translate property references into document field names.ATypedAggregation
is a specialAggregation
that holds information of the input aggregation type.The $unionWith aggregation stage (available since MongoDB 4.4) performs a union of two collections by combining pipeline results, potentially containing duplicates, into a single result set that is handed over to the next stage.Removes fields from documents.Encapsulates the aggregation framework$unwind
-operation.Builder for fluentUnwindOperation
creation.Gateway to variable aggregation operations.AggregationExpression
for$let
that bindsAggregationExpression
to variables for use in the specifiedin
expression, and returns the result of the expression.AggregationExpression
for$map
.