Package org.springframework.data.mongodb.core.aggregation
@NullMarked
package org.springframework.data.mongodb.core.aggregation
Support for the MongoDB aggregation framework.
- Since:
- 1.3
-
ClassDescriptionGateway to accumulator aggregation operations.
AggregationExpressionfor$avg.AggregationExpressionfor$covariancePop.AggregationExpressionfor$covarianceSamp.AccumulatorOperators.ExpMovingAvgcalculates the exponential moving average of numeric values.Builder forAccumulatorOperators.ExpMovingAvg.AggregationExpressionfor$max.AggregationExpressionfor$median.AggregationExpressionfor$min.AggregationExpressionfor$percentile.AggregationExpressionfor$stdDevPop.AggregationExpressionfor$stdDevSamp.AggregationExpressionfor$sum.Adds new fields to documents.AnAggregationis a representation of a list of aggregation steps to be performed by the MongoDB Aggregation Framework.AnAggregationExpressioncan be used with field expressions in aggregation pipeline stages likeprojectandgroup.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.TheAggregationPipelineholds the collection ofaggregation stages.Collects the results of executing an aggregation operation.AnAggregationExpressionthat 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.A special field that points to a variable$$expression.Gateway to Arithmetic aggregation operations that perform math operations on numbers.AggregationExpressionfor$abs.Anexpressionthat calculates the inverse cosine of a value.Anexpressionthat calculates the inverse hyperbolic cosine of a value.AggregationExpressionfor$add.The unit of measure for computations that operate upon angles.Anexpressionthat calculates the inverse sine of a value.Anexpressionthat calculates the inverse hyperbolic sine of a valueAnexpressionthat calculates the inverse tangent of a value.Anexpressionthat calculates the inverse tangent of y / x, where y and x are the first and second values passed to the expression respectively.Anexpressionthat calculates the inverse hyperbolic tangent of a valueAggregationExpressionfor$ceil.Anexpressionthat calculates the cosine of a value that is measured in radians.Anexpressionthat calculates the hyperbolic cosine of a value that is measured inArithmeticOperators.AngularUnit.RADIANS.Value object to represent anexpressionthat calculates the average rate of change within the specified window.AggregationExpressionfor$divide.AggregationExpressionfor$exp.AggregationExpressionfor$floor.Value object to represent anexpressionthat calculates the approximation for the mathematical integral value.AggregationExpressionfor$ln.AggregationExpressionfor$log.AggregationExpressionfor$log10.AggregationExpressionfor$mod.AggregationExpressionfor$multiply.AggregationExpressionfor$pow.ArithmeticOperators.Randreturns a floating value between 0 and 1.ArithmeticOperators.Roundrounds a number to a whole integer or to a specified decimal place.Anexpressionthat calculates the sine of a value that is measured in radians.Anexpressionthat calculates the hyperbolic sine of a value that is measured inArithmeticOperators.AngularUnit.RADIANS.AggregationExpressionfor$sqrt.AggregationExpressionfor$subtract.Anexpressionthat calculates the tangent of a value that is measured in radians.Anexpressionthat calculates the hyperbolic tangent of a value that is measured inArithmeticOperators.AngularUnit.RADIANS.AggregationExpressionfor$trunc.Gateway to array aggregation operations.AggregationExpressionfor$arrayElementAt.AggregationExpressionfor$arrayToObjectthat transforms an array into a single document.AggregationExpressionfor$concatArrays.$filterAggregationExpressionallows to select a subset of the array to return based on the specified condition.AggregationExpressionfor$firstthat returns the first element in an array.AggregationExpressionfor$in.AggregationExpressionfor$indexOfArray.AggregationExpressionfor$isArray.AggregationExpressionfor$lastthat returns the last element in an array.AggregationExpressionfor$range.AggregationExpressionfor$reduce.AggregationExpressionfor$reverseArray.AggregationExpressionfor$size.AggregationExpressionfor$slice.AggregationExpressionfor$sortArraythat sorts elements in an array.AggregationExpressionfor$zip.Gateway to boolean expressions that evaluate their argument expressions as booleans and return a boolean as the result.AggregationExpressionfor$and.AggregationExpressionfor$not.AggregationExpressionfor$or.Encapsulates the aggregation framework$bucketAuto-operation.BucketOperationSupport.OutputBuilderimplementation forBucketAutoOperation.BucketOperationSupport.ExpressionBucketOperationBuilderSupportimplementation forBucketAutoOperationusing SpEL expression basedBucketOperationSupport.Output.Supported MongoDB granularities.Encapsulates the aggregation framework$bucket-operation.BucketOperationSupport.OutputBuilderimplementation forBucketOperation.BucketOperationSupport.ExpressionBucketOperationBuilderSupportimplementation forBucketOperationusing 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.Outputbuilders that result in aBucketOperationSupportproviding the builtBucketOperationSupport.Output.EncapsulatesBucketOperationSupport.Outputs.Gateway to comparison expressions.AggregationExpressionfor$cmp.AggregationExpressionfor$eq.AggregationExpressionfor$gt.AggregationExpressionfor$gte.AggregationExpressionfor$lt.AggregationExpressionfor$lte.AggregationExpressionfor$ne.Gateway to conditional expressions that evaluate their argument expressions as booleans to a value.Encapsulates the aggregation framework$condoperator.Encapsulates the aggregation framework$ifNulloperator.AggregationExpressionfor$switch.Encapsulates the aggregation framework case document inside a$switch-operation.Gateway to convert aggregation operations.AggregationExpressionfor$convertthat converts a value to a specified type.AggregationExpressionfor$degreesToRadiansthat converts an input value measured in degrees to radians.AggregationExpressionfor$toBoolthat converts a value to boolean.AggregationExpressionfor$toDatethat converts a value to date.AggregationExpressionfor$toDecimalthat converts a value to decimal.AggregationExpressionfor$toDoublethat converts a value to double.AggregationExpressionfor$toIntthat converts a value to integer.AggregationExpressionfor$toLongthat converts a value to long.AggregationExpressionfor$toObjectIdthat converts a value to objectId.AggregationExpressionfor$toStringthat converts a value to string.Encapsulates the aggregation framework$count-operation.Builder forCountOperation.Gateway to data type expressions.AggregationExpressionfor$type.Gateway to Date aggregation operations.DateOperators.DateParts<T extends DateOperators.DateParts<T>>AggregationExpressionfor$dateToString.AggregationExpressionfor$dayOfMonth.AggregationExpressionfor$dayOfWeek.AggregationExpressionfor$dayOfYear.AggregationExpressionfor$hour.AggregationExpressionfor$isoDayOfWeek.AggregationExpressionfor$isoWeek.AggregationExpressionfor$isoWeekYear.AggregationExpressionfor$millisecond.AggregationExpressionfor$minute.AggregationExpressionfor$month.AggregationExpressionfor$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.AggregationExpressioncapable of setting a givenDateOperators.Timezone.AggregationExpressionfor$tsIncrement.AggregationExpressionfor$tsSecond.AggregationExpressionfor$week.AggregationExpressionfor$year.Encapsulates the aggregation framework$densify-operation.DensifyOperation.Rangeimplementation holding lower and upper bound values.BaseDensifyOperation.Rangeimplementation.The actual time unit to apply to aDensifyOperation.Range.Quick access to availableunits.TheDensifyOperation.Rangespecifies how the data is densified.Gateway to document expressions such as $rank, $documentNumber, etc.DocumentOperators.DenseRankresolves the current document position (the rank) relative to other documents.DocumentOperators.DocumentNumberresolves the current document position.DocumentOperators.Rankresolves 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 forFacetOperationby adding existing and the new pipeline ofAggregationOperationto the newFacetOperation.Abstraction for a field.Lookup policy for aggregation fields.Value object to capture a list ofFieldinstances.AggregationOperationthat exposesExposedFieldsthat can be used for later aggregation pipelineAggregationOperations.Marker interface forAggregationOperationthat inherits fields from previous operations.Represents ageoNearaggregation operation.Encapsulates the aggregation framework$graphLookup-operation.Encapsulates the aggregation framework$group-operation.Builder forGroupOperations on a field.Encapsulates the$limit-operation.Gateway to literal aggregation operations.AggregationExpressionfor$literal.Encapsulates the aggregation framework$lookup-operation.Builder for fluentLookupOperationcreation.Encapsulates the$match-operation.Encapsulates the$merge-operation.Builder API to construct aMergeOperation.Value Object representing theintofield of a$mergeaggregation 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 theonproperty 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 theonproperty describing the unique identifier.Gateway for object expression operators.AggregationExpressionfor$getField.AggregationExpressionfor$mergeObjectsthat combines multiple documents into a single document.AggregationExpressionfor$objectToArraythat converts a document to an array ofdocumentsthat each contains two fields k and v.AggregationExpressionfor$setField.Encapsulates the$out-operation.AggregationOperationContextimplementation prefixing non-command keys on root level with the given prefix.Encapsulates the aggregation framework$project-operation.Builder forarrayprojections.AnProjectionOperation.ProjectionOperationBuilderthat is used for SpEL expression based projections.Builder forProjectionOperations on a field.RedactOperationallows to restrict the content of aDocumentbased on information stored within itself.Builder to create new instance ofRedactOperation.Deprecated.since 4.3.1Encapsulates 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.ReplaceRootDocumentOperationto populateReplaceRootOperation.ReplacementDocumentBuilder forReplaceRootOperation.Encapsulates the aggregation framework$replaceRoot-operation.Encapsulates the$sample-operation.Gateway to $function and $accumulator aggregation operations.ScriptOperators.Accumulatordefines 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.Functiondefines a custom aggregation $function in JavaScript.Gateway to selection operators such as $bottom.AbstractAggregationExpressionto return the bottom element according to the specifiedorder.AbstractAggregationExpressionto return the $firstN elements.AbstractAggregationExpressionto return the $lastN elements.AbstractAggregationExpressionto 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.AggregationExpressionfor$allElementsTrue.AggregationExpressionfor$anyElementTrue.AggregationExpressionfor$setDifference.AggregationExpressionfor$setEquals.AggregationExpressionfor$setIntersection.AggregationExpressionfor$setIsSubset.AggregationExpressionfor$setUnion.Encapsulates thesetWindowFields-operation.AFieldthat the result of a computation done via anAggregationExpression.SetWindowFieldsOperation.Windowimplementation based on the current document.Builder API for aSetWindowFieldsOperation.RangeWindow.SetWindowFieldsOperation.Windowimplementation 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.Windowapplicable to the field computation.ASetWindowFieldsOperation.Windowto be used forComputedField.SetWindowFieldsOperation.WindowOutputdefines output of $setWindowFields stage by defining thefield(s)to append to the documents in the output.Tiny little helper to allow fluent API usage forSetWindowFieldsOperation.WindowOutput.append(ComputedField).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.AggregationExpressionfor$concat.AggregationExpressionfor$indexOfBytes.AggregationExpressionfor$indexOfCP.AggregationExpressionfor$ltrimwhich removes whitespace or the specified characters from the beginning of a string.AggregationExpressionfor$regexFindwhich applies a regular expression (regex) to a string and returns information on the first matched substring.AggregationExpressionfor$regexFindAllwhich applies a regular expression (regex) to a string and returns information on all the matched substrings.AggregationExpressionfor$regexMatchwhich applies a regular expression (regex) to a string and returns a boolean that indicates if a match is found or not.AggregationExpressionfor$replaceAllwhich replaces all instances of a search string in an input string with a replacement string.AggregationExpressionfor$replaceOnewhich replaces the first instance of a search string in an input string with a replacement string.AggregationExpressionfor$rtrimwhich removes whitespace or the specified characters from the end of a string.AggregationExpressionfor$split.AggregationExpressionfor$strcasecmp.AggregationExpressionfor$strLenBytes.AggregationExpressionfor$strLenCP.AggregationExpressionfor$substr.AggregationExpressionfor$substrCP.AggregationExpressionfor$toLower.AggregationExpressionfor$toUpper.AggregationExpressionfor$trimwhich 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.AggregationOperationContextaware of a particular type and aMappingContextto potentially translate property references into document field names.ATypedAggregationis a specialAggregationthat 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 fluentUnwindOperationcreation.Gateway to variable aggregation operations.AggregationExpressionfor$letthat bindsAggregationExpressionto variables for use in the specifiedinexpression, and returns the result of the expression.AggregationExpressionfor$map.Performs a semantic search on data in your Atlas cluster.Fluent API to configure a limit on the VectorSearchOperation builder.Fluent API to configure a path on the VectorSearchOperation builder.Interface describing a query path contract.Value object capturing query paths.Search type, ANN as approximation or ENN for exact search.Fluent API to configure a vector on the VectorSearchOperation builder.