Class AggregatorImpl<T,R>
- All Implemented Interfaces:
Aggregator<T,R>
-
Nested Class Summary
Nested classes/interfaces inherited from interface de.caluga.morphium.aggregation.Aggregator
Aggregator.BucketGranularity, Aggregator.GeoNearFields, Aggregator.MergeActionWhenMatched, Aggregator.MergeActionWhenNotMatched -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAggregator<T,R> voidaddOperator(Map<String, Object> o) voidaggregate(AsyncOperationCallback<R> callback) voidaggregateMap(AsyncOperationCallback<Map<String, Object>> callback) Aggregator<T,R> Categorizes incoming documents into groups, called buckets, based on a specified expression and bucket boundaries and outputs a document per each bucket.Aggregator<T,R> bucketAuto(Expr groupBy, int numBuckets, Map<String, Expr> output, Aggregator.BucketGranularity granularity) Aggregator<T,R> Aggregator<T,R> Aggregator<T,R> Aggregator<T,R> Aggregator<T,R> currentOp(boolean allUsers, boolean idleConnections, boolean idleCursors, boolean idleSessions, boolean localOps) Aggregator<T,R> facet(Map<String, Aggregator> facets) Aggregator<T,R> Aggregator<T,R> genericStage(String stageName, Object param) Aggregator<T,R> geoNear(Map<Aggregator.GeoNearFields, Object> param) longgetCount()Aggregator<T,R> graphLookup(Class<?> type, Expr startWith, Enum connectFromField, Enum connectToField, String as, Integer maxDepth, String depthField, Query restrictSearchWithMatch) Aggregator<T,R> graphLookup(Class<?> type, Expr startWith, String connectFromField, String connectToField, String as, Integer maxDepth, String depthField, Query restrictSearchWithMatch) Aggregator<T,R> graphLookup(String fromCollection, Expr startWith, String connectFromField, String connectToField, String as, Integer maxDepth, String depthField, Query restrictSearchWithMatch) Aggregator<T,R> booleanbooleanAggregator<T,R> limit(int num) Aggregator<T,R> Aggregator<T,R> listLocalSessions(List<String> users, List<String> dbs) Aggregator<T,R> Aggregator<T,R> Aggregator<T,R> listSessions(List<String> users, List<String> dbs) Aggregator<T,R> Aggregator<T,R> lookup(Class fromType, Enum localField, Enum foreignField, String outputArray, List<Expr> pipeline, Map<String, Expr> let) $lookup: { from:, localField: , foreignField: invalid input: '<'field from the documents of the "from" collection>, as: Aggregator<T,R> lookup(String fromCollection, String localField, String foreignField, String outputArray, List<Expr> pipeline, Map<String, Expr> let) Aggregator<T,R> Aggregator<T,R> Aggregator<T,R> matchSubQuery(Query<?> q) Aggregator<T,R> Aggregator<T,R> merge(Class<?> intoCollection, Map<String, Expr> let, List<Map<String, Expr>> machedPipeline, Aggregator.MergeActionWhenMatched matchAction, Aggregator.MergeActionWhenNotMatched notMatchedAction, String... onFields) Aggregator<T,R> Aggregator<T,R> merge(String intoCollection, Aggregator.MergeActionWhenMatched matchAction, Aggregator.MergeActionWhenNotMatched notMatchedAction, String... onFields) Aggregator<T,R> Aggregator<T,R> merge(String intoDb, String intoCollection, Aggregator.MergeActionWhenMatched matchAction, Aggregator.MergeActionWhenNotMatched notMatchedAction, String... onFields) Aggregator<T,R> merge(String intoCollection, Map<String, Expr> let, List<Map<String, Expr>> machedPipeline, Aggregator.MergeActionWhenNotMatched notMatchedAction, String... onFields) Aggregator<T,R> Aggregator<T,R> Aggregator<T,R> Aggregator<T,R> planCacheStats(Map<String, Object> param) Aggregator<T,R> Aggregator<T,R> Aggregator<T,R> Aggregator<T,R> redact needs to resolve to $$DESCEND, $$PRUNE, or $$KEEPAggregator<T,R> replaceRoot(Expr newRoot) Aggregator<T,R> replaceWith(Expr newDoc) Replaces the input document with the specified document.Aggregator<T,R> sample(int sampleSize) Randomly selects the specified number of documents from its input.Aggregator<T,R> Adds new fields to documents.voidvoidsetExplain(boolean explain) voidvoidsetResultType(Class<? extends R> type) voidsetSearchType(Class<? extends T> type) voidsetUseDisk(boolean useDisk) Aggregator<T,R> skip(int num) Aggregator<T,R> Aggregator<T,R> Aggregator<T,R> sortByCount(Expr sortby) The $sortByCount stage is equivalent to the following $group + $sort sequence:Aggregator<T,R> unionWith(Aggregator agg) Aggregator<T,R> Aggregator<T,R> Aggregator<T,R> Aggregator<T,R> Aggregator<T,R> Aggregator<T,R>
-
Constructor Details
-
AggregatorImpl
-
-
Method Details
-
getCollation
- Specified by:
getCollationin interfaceAggregator<T,R>
-
isUseDisk
public boolean isUseDisk()- Specified by:
isUseDiskin interfaceAggregator<T,R>
-
setUseDisk
public void setUseDisk(boolean useDisk) - Specified by:
setUseDiskin interfaceAggregator<T,R>
-
isExplain
public boolean isExplain()- Specified by:
isExplainin interfaceAggregator<T,R>
-
setExplain
public void setExplain(boolean explain) - Specified by:
setExplainin interfaceAggregator<T,R>
-
getMorphium
- Specified by:
getMorphiumin interfaceAggregator<T,R>
-
setMorphium
- Specified by:
setMorphiumin interfaceAggregator<T,R>
-
getSearchType
- Specified by:
getSearchTypein interfaceAggregator<T,R>
-
setSearchType
- Specified by:
setSearchTypein interfaceAggregator<T,R>
-
getResultType
- Specified by:
getResultTypein interfaceAggregator<T,R>
-
setResultType
- Specified by:
setResultTypein interfaceAggregator<T,R>
-
project
- Specified by:
projectin interfaceAggregator<T,R>
-
project
- Specified by:
projectin interfaceAggregator<T,R>
-
project
- Specified by:
projectin interfaceAggregator<T,R>
-
addFields
- Specified by:
addFieldsin interfaceAggregator<T,R>
-
match
- Specified by:
matchin interfaceAggregator<T,R>
-
matchSubQuery
- Specified by:
matchSubQueryin interfaceAggregator<T,R>
-
match
- Specified by:
matchin interfaceAggregator<T,R>
-
limit
- Specified by:
limitin interfaceAggregator<T,R>
-
skip
- Specified by:
skipin interfaceAggregator<T,R>
-
unwind
- Specified by:
unwindin interfaceAggregator<T,R>
-
unwind
- Specified by:
unwindin interfaceAggregator<T,R>
-
sort
- Specified by:
sortin interfaceAggregator<T,R>
-
sort
- Specified by:
sortin interfaceAggregator<T,R>
-
getCollectionName
- Specified by:
getCollectionNamein interfaceAggregator<T,R>
-
setCollectionName
- Specified by:
setCollectionNamein interfaceAggregator<T,R>
-
group
- Specified by:
groupin interfaceAggregator<T,R>
-
group
- Specified by:
groupin interfaceAggregator<T,R>
-
group
- Specified by:
groupin interfaceAggregator<T,R>
-
addOperator
- Specified by:
addOperatorin interfaceAggregator<T,R>
-
aggregate
- Specified by:
aggregatein interfaceAggregator<T,R>
-
getCount
public long getCount()- Specified by:
getCountin interfaceAggregator<T,R>
-
aggregateIterable
- Specified by:
aggregateIterablein interfaceAggregator<T,R>
-
aggregate
- Specified by:
aggregatein interfaceAggregator<T,R>
-
aggregateMap
- Specified by:
aggregateMapin interfaceAggregator<T,R>
-
aggregateMap
- Specified by:
aggregateMapin interfaceAggregator<T,R>
-
getAggregateCmd
- Specified by:
getAggregateCmdin interfaceAggregator<T,R>
-
getPipeline
- Specified by:
getPipelinein interfaceAggregator<T,R>
-
count
- Specified by:
countin interfaceAggregator<T,R>
-
count
- Specified by:
countin interfaceAggregator<T,R>
-
out
- Specified by:
outin interfaceAggregator<T,R>
-
bucket
public Aggregator<T,R> bucket(Expr groupBy, List<Expr> boundaries, Expr preset, Map<String, Expr> output) Categorizes incoming documents into groups, called buckets, based on a specified expression and bucket boundaries and outputs a document per each bucket. Each output document contains an _id field whose value specifies the inclusive lower bound of the bucket. The output option specifies the fields included in each output document.$bucket only produces output documents for buckets that contain at least one input document.
- Specified by:
bucketin interfaceAggregator<T,R> - Parameters:
groupBy- : Expression to group by, usually a field nameboundaries- : Boundaries for the bucketspreset- : the default, needs to be a literaloutput- : definition of output documents and accumulator- Returns:
-
bucketAuto
public Aggregator<T,R> bucketAuto(Expr groupBy, int numBuckets, Map<String, Expr> output, Aggregator.BucketGranularity granularity) - Specified by:
bucketAutoin interfaceAggregator<T,R>
-
collStats
public Aggregator<T,R> collStats(Boolean latencyHistograms, Double scale, boolean count, boolean queryExecStats) - Specified by:
collStatsin interfaceAggregator<T,R> - Parameters:
latencyHistograms- : if null, no latency statsscale- : if null, no storageStats- Returns:
-
currentOp
public Aggregator<T,R> currentOp(boolean allUsers, boolean idleConnections, boolean idleCursors, boolean idleSessions, boolean localOps) - Specified by:
currentOpin interfaceAggregator<T,R>
-
facetExpr
- Specified by:
facetExprin interfaceAggregator<T,R>
-
facet
- Specified by:
facetin interfaceAggregator<T,R>
-
geoNear
- Specified by:
geoNearin interfaceAggregator<T,R>
-
graphLookup
public Aggregator<T,R> graphLookup(Class<?> type, Expr startWith, Enum connectFromField, Enum connectToField, String as, Integer maxDepth, String depthField, Query restrictSearchWithMatch) - Specified by:
graphLookupin interfaceAggregator<T,R>
-
graphLookup
public Aggregator<T,R> graphLookup(Class<?> type, Expr startWith, String connectFromField, String connectToField, String as, Integer maxDepth, String depthField, Query restrictSearchWithMatch) - Specified by:
graphLookupin interfaceAggregator<T,R>
-
graphLookup
public Aggregator<T,R> graphLookup(String fromCollection, Expr startWith, String connectFromField, String connectToField, String as, Integer maxDepth, String depthField, Query restrictSearchWithMatch) - Specified by:
graphLookupin interfaceAggregator<T,R>
-
indexStats
- Specified by:
indexStatsin interfaceAggregator<T,R>
-
listLocalSessionsAllUsers
- Specified by:
listLocalSessionsAllUsersin interfaceAggregator<T,R>
-
listLocalSessions
- Specified by:
listLocalSessionsin interfaceAggregator<T,R>
-
listLocalSessions
- Specified by:
listLocalSessionsin interfaceAggregator<T,R>
-
listSessionsAllUsers
- Specified by:
listSessionsAllUsersin interfaceAggregator<T,R>
-
listSessions
- Specified by:
listSessionsin interfaceAggregator<T,R>
-
listSessions
- Specified by:
listSessionsin interfaceAggregator<T,R>
-
lookup
public Aggregator<T,R> lookup(Class fromType, Enum localField, Enum foreignField, String outputArray, List<Expr> pipeline, Map<String, Expr> let) $lookup: { from:, localField: , foreignField: invalid input: '<'field from the documents of the "from" collection>, as: - Specified by:
lookupin interfaceAggregator<T,R> - Returns:
-
lookup
public Aggregator<T,R> lookup(String fromCollection, String localField, String foreignField, String outputArray, List<Expr> pipeline, Map<String, Expr> let) - Specified by:
lookupin interfaceAggregator<T,R>
-
merge
public Aggregator<T,R> merge(String intoDb, String intoCollection, Aggregator.MergeActionWhenMatched matchAction, Aggregator.MergeActionWhenNotMatched notMatchedAction, String... onFields) - Specified by:
mergein interfaceAggregator<T,R>
-
merge
public Aggregator<T,R> merge(String intoCollection, Map<String, Expr> let, List<Map<String, Expr>> machedPipeline, Aggregator.MergeActionWhenNotMatched notMatchedAction, String... onFields) - Specified by:
mergein interfaceAggregator<T,R>
-
merge
public Aggregator<T,R> merge(Class<?> intoCollection, Map<String, Expr> let, List<Map<String, Expr>> machedPipeline, Aggregator.MergeActionWhenMatched matchAction, Aggregator.MergeActionWhenNotMatched notMatchedAction, String... onFields) - Specified by:
mergein interfaceAggregator<T,R>
-
merge
- Specified by:
mergein interfaceAggregator<T,R>
-
merge
- Specified by:
mergein interfaceAggregator<T,R>
-
merge
- Specified by:
mergein interfaceAggregator<T,R>
-
merge
public Aggregator<T,R> merge(String intoCollection, Aggregator.MergeActionWhenMatched matchAction, Aggregator.MergeActionWhenNotMatched notMatchedAction, String... onFields) - Specified by:
mergein interfaceAggregator<T,R>
-
out
- Specified by:
outin interfaceAggregator<T,R>
-
out
- Specified by:
outin interfaceAggregator<T,R>
-
planCacheStats
- Specified by:
planCacheStatsin interfaceAggregator<T,R>
-
redact
redact needs to resolve to $$DESCEND, $$PRUNE, or $$KEEPSystem Variable Description $$DESCEND $redact returns the fields at the current document level, excluding embedded documents. To include embedded documents and embedded documents within arrays, apply the $cond expression to the embedded documents to determine access for these embedded documents. $$PRUNE $redact excludes all fields at this current document/embedded document level, without further inspection of any of the excluded fields. This applies even if the excluded field contains embedded documents that may have different access levels. $$KEEP $redact returns or keeps all fields at this current document/embedded document level, without further inspection of the fields at this level. This applies even if the included field contains embedded documents that may have different access levels.
- Specified by:
redactin interfaceAggregator<T,R> - Returns:
-
replaceRoot
- Specified by:
replaceRootin interfaceAggregator<T,R>
-
replaceWith
Description copied from interface:AggregatorReplaces the input document with the specified document. The operation replaces all existing fields in the input document, including the _id field. With $replaceWith, you can promote an embedded document to the top-level. You can also specify a new document as the replacement.- Specified by:
replaceWithin interfaceAggregator<T,R> - Returns:
-
sample
Description copied from interface:AggregatorRandomly selects the specified number of documents from its input.- Specified by:
samplein interfaceAggregator<T,R> - Returns:
-
set
Adds new fields to documents. $set outputs documents that contain all existing fields from the input documents and newly added fields.The $set stage is an alias for $addFields.
- Specified by:
setin interfaceAggregator<T,R> - Parameters:
param-- Returns:
-
sortByCount
The $sortByCount stage is equivalent to the following $group + $sort sequence:{ $group: { _id:
, count: { $sum: 1 } } }, { $sort: { count: -1 } } - Specified by:
sortByCountin interfaceAggregator<T,R> - Parameters:
sortby-- Returns:
-
unionWith
- Specified by:
unionWithin interfaceAggregator<T,R>
-
unionWith
- Specified by:
unionWithin interfaceAggregator<T,R>
-
unset
- Specified by:
unsetin interfaceAggregator<T,R>
-
unset
- Specified by:
unsetin interfaceAggregator<T,R>
-
unset
- Specified by:
unsetin interfaceAggregator<T,R>
-
genericStage
- Specified by:
genericStagein interfaceAggregator<T,R>
-
collation
- Specified by:
collationin interfaceAggregator<T,R>
-