public class InMemAggregator<T,R> extends Object implements Aggregator<T,R>
Aggregator.BucketGranularity, Aggregator.GeoNearFields, Aggregator.MergeActionWhenMatched, Aggregator.MergeActionWhenNotMatched| Constructor and Description |
|---|
InMemAggregator() |
| Modifier and Type | Method and Description |
|---|---|
Aggregator<T,R> |
addFields(Map<String,Object> m) |
void |
addOperator(Map<String,Object> o) |
List<R> |
aggregate() |
void |
aggregate(AsyncOperationCallback<R> callback) |
MorphiumAggregationIterator<T,R> |
aggregateIterable() |
List<Map<String,Object>> |
aggregateMap() |
void |
aggregateMap(AsyncOperationCallback<Map<String,Object>> callback) |
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.
|
Aggregator<T,R> |
bucketAuto(Expr groupBy,
int numBuckets,
Map<String,Expr> output,
Aggregator.BucketGranularity granularity) |
Aggregator<T,R> |
collation(Collation collation) |
Aggregator<T,R> |
collStats(Boolean latencyHistograms,
Double scale,
boolean count,
boolean queryExecStats) |
Aggregator<T,R> |
count(Enum fld) |
Aggregator<T,R> |
count(String fld) |
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> |
facetExpr(Map<String,Expr> facets) |
Aggregator<T,R> |
genericStage(String stageName,
Object param) |
Aggregator<T,R> |
geoNear(Map<Aggregator.GeoNearFields,Object> param) |
Collation |
getCollation() |
String |
getCollectionName() |
long |
getCount() |
Morphium |
getMorphium() |
List<Map<String,Object>> |
getPipeline() |
Class<? extends R> |
getResultType() |
Class<? extends T> |
getSearchType() |
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) |
Group<T,R> |
group(Expr id) |
Group<T,R> |
group(Map<String,Object> id) |
Group<T,R> |
group(String id) |
Aggregator<T,R> |
indexStats() |
boolean |
isExplain() |
boolean |
isUseDisk() |
Aggregator<T,R> |
limit(int num) |
Aggregator<T,R> |
listLocalSessions() |
Aggregator<T,R> |
listLocalSessions(List<String> users,
List<String> dbs) |
Aggregator<T,R> |
listLocalSessionsAllUsers() |
Aggregator<T,R> |
listSessions() |
Aggregator<T,R> |
listSessions(List<String> users,
List<String> dbs) |
Aggregator<T,R> |
listSessionsAllUsers() |
Aggregator<T,R> |
lookup(Class fromType,
Enum localField,
Enum foreignField,
String outputArray,
List<Expr> pipeline,
Map<String,Expr> let)
$lookup:
{
from:
|
Aggregator<T,R> |
lookup(String fromCollection,
String localField,
String foreignField,
String outputArray,
List<Expr> pipeline,
Map<String,Expr> let) |
Aggregator<T,R> |
match(Expr q) |
Aggregator<T,R> |
match(Query<T> q) |
Aggregator<T,R> |
matchSubQuery(Query<?> q) |
Aggregator<T,R> |
merge(Class<?> intoCollection) |
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> |
merge(String intoCollection) |
Aggregator<T,R> |
merge(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> |
merge(String intoDb,
String intoCollection) |
Aggregator<T,R> |
merge(String intoDb,
String intoCollection,
Aggregator.MergeActionWhenMatched matchAction,
Aggregator.MergeActionWhenNotMatched notMatchedAction,
String... onFields) |
Aggregator<T,R> |
out(Class<?> type) |
Aggregator<T,R> |
out(String collectionName) |
Aggregator<T,R> |
out(String db,
String collectionName) |
Aggregator<T,R> |
planCacheStats(Map<String,Object> param) |
Aggregator<T,R> |
project(Map<String,Object> m) |
Aggregator<T,R> |
project(String... m) |
Aggregator<T,R> |
project(String fld,
Expr e) |
Aggregator<T,R> |
redact(Expr redact)
redact needs to resolve to $$DESCEND, $$PRUNE, or $$KEEP
System Variable Description
$$DESCEND $redact returns the fields at the current document level, excluding embedded documents.
|
Aggregator<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> |
set(Map<String,Expr> param)
Adds new fields to documents.
|
void |
setCollectionName(String cn) |
void |
setExplain(boolean explain) |
void |
setMorphium(Morphium m) |
void |
setResultType(Class<? extends R> type) |
void |
setSearchType(Class<? extends T> type) |
void |
setUseDisk(boolean useDisk) |
Aggregator<T,R> |
skip(int num) |
Aggregator<T,R> |
sort(Map<String,Integer> sort) |
Aggregator<T,R> |
sort(String... prefixed) |
Aggregator<T,R> |
sortByCount(Expr sortby)
The $sortByCount stage is equivalent to the following $group + $sort sequence:
{ $group: { _id:
|
Aggregator<T,R> |
unionWith(Aggregator agg) |
Aggregator<T,R> |
unionWith(String collection) |
Aggregator<T,R> |
unset(Enum... field) |
Aggregator<T,R> |
unset(List<String> field) |
Aggregator<T,R> |
unset(String... param) |
Aggregator<T,R> |
unwind(Expr field) |
Aggregator<T,R> |
unwind(String listField) |
public Collation getCollation()
getCollation in interface Aggregator<T,R>public boolean isUseDisk()
isUseDisk in interface Aggregator<T,R>public void setUseDisk(boolean useDisk)
setUseDisk in interface Aggregator<T,R>public boolean isExplain()
isExplain in interface Aggregator<T,R>public void setExplain(boolean explain)
setExplain in interface Aggregator<T,R>public Morphium getMorphium()
getMorphium in interface Aggregator<T,R>public void setMorphium(Morphium m)
setMorphium in interface Aggregator<T,R>public Class<? extends T> getSearchType()
getSearchType in interface Aggregator<T,R>public void setSearchType(Class<? extends T> type)
setSearchType in interface Aggregator<T,R>public Class<? extends R> getResultType()
getResultType in interface Aggregator<T,R>public void setResultType(Class<? extends R> type)
setResultType in interface Aggregator<T,R>public Aggregator<T,R> project(Map<String,Object> m)
project in interface Aggregator<T,R>public Aggregator<T,R> project(String fld, Expr e)
project in interface Aggregator<T,R>public Aggregator<T,R> project(String... m)
project in interface Aggregator<T,R>public Aggregator<T,R> addFields(Map<String,Object> m)
addFields in interface Aggregator<T,R>public Aggregator<T,R> match(Query<T> q)
match in interface Aggregator<T,R>public Aggregator<T,R> matchSubQuery(Query<?> q)
matchSubQuery in interface Aggregator<T,R>public Aggregator<T,R> match(Expr q)
match in interface Aggregator<T,R>public Aggregator<T,R> limit(int num)
limit in interface Aggregator<T,R>public Aggregator<T,R> skip(int num)
skip in interface Aggregator<T,R>public Aggregator<T,R> unwind(String listField)
unwind in interface Aggregator<T,R>public Aggregator<T,R> unwind(Expr field)
unwind in interface Aggregator<T,R>public Aggregator<T,R> sort(String... prefixed)
sort in interface Aggregator<T,R>public Aggregator<T,R> sort(Map<String,Integer> sort)
sort in interface Aggregator<T,R>public String getCollectionName()
getCollectionName in interface Aggregator<T,R>public void setCollectionName(String cn)
setCollectionName in interface Aggregator<T,R>public Group<T,R> group(Map<String,Object> id)
group in interface Aggregator<T,R>public void addOperator(Map<String,Object> o)
addOperator in interface Aggregator<T,R>public long getCount()
getCount in interface Aggregator<T,R>public MorphiumAggregationIterator<T,R> aggregateIterable()
aggregateIterable in interface Aggregator<T,R>public void aggregate(AsyncOperationCallback<R> callback)
aggregate in interface Aggregator<T,R>public void aggregateMap(AsyncOperationCallback<Map<String,Object>> callback)
aggregateMap in interface Aggregator<T,R>public List<Map<String,Object>> getPipeline()
getPipeline in interface Aggregator<T,R>public Aggregator<T,R> count(String fld)
count in interface Aggregator<T,R>public Aggregator<T,R> count(Enum fld)
count in interface Aggregator<T,R>public Aggregator<T,R> bucket(Expr groupBy, List<Expr> boundaries, Expr preset, Map<String,Expr> output)
$bucket only produces output documents for buckets that contain at least one input document. wear)
bucket in interface Aggregator<T,R>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 accumulatorpublic Aggregator<T,R> bucketAuto(Expr groupBy, int numBuckets, Map<String,Expr> output, Aggregator.BucketGranularity granularity)
bucketAuto in interface Aggregator<T,R>public Aggregator<T,R> collStats(Boolean latencyHistograms, Double scale, boolean count, boolean queryExecStats)
collStats in interface Aggregator<T,R>public Aggregator<T,R> currentOp(boolean allUsers, boolean idleConnections, boolean idleCursors, boolean idleSessions, boolean localOps)
currentOp in interface Aggregator<T,R>public Aggregator<T,R> facetExpr(Map<String,Expr> facets)
facetExpr in interface Aggregator<T,R>public Aggregator<T,R> facet(Map<String,Aggregator> facets)
facet in interface Aggregator<T,R>public Aggregator<T,R> geoNear(Map<Aggregator.GeoNearFields,Object> param)
geoNear in interface Aggregator<T,R>public Aggregator<T,R> graphLookup(Class<?> type, Expr startWith, Enum connectFromField, Enum connectToField, String as, Integer maxDepth, String depthField, Query restrictSearchWithMatch)
graphLookup in interface Aggregator<T,R>public Aggregator<T,R> graphLookup(Class<?> type, Expr startWith, String connectFromField, String connectToField, String as, Integer maxDepth, String depthField, Query restrictSearchWithMatch)
graphLookup in interface Aggregator<T,R>public Aggregator<T,R> graphLookup(String fromCollection, Expr startWith, String connectFromField, String connectToField, String as, Integer maxDepth, String depthField, Query restrictSearchWithMatch)
graphLookup in interface Aggregator<T,R>public Aggregator<T,R> indexStats()
indexStats in interface Aggregator<T,R>public Aggregator<T,R> listLocalSessionsAllUsers()
listLocalSessionsAllUsers in interface Aggregator<T,R>public Aggregator<T,R> listLocalSessions()
listLocalSessions in interface Aggregator<T,R>public Aggregator<T,R> listLocalSessions(List<String> users, List<String> dbs)
listLocalSessions in interface Aggregator<T,R>public Aggregator<T,R> listSessionsAllUsers()
listSessionsAllUsers in interface Aggregator<T,R>public Aggregator<T,R> listSessions()
listSessions in interface Aggregator<T,R>public Aggregator<T,R> listSessions(List<String> users, List<String> dbs)
listSessions in interface Aggregator<T,R>public Aggregator<T,R> lookup(Class fromType, Enum localField, Enum foreignField, String outputArray, List<Expr> pipeline, Map<String,Expr> let)
lookup in interface Aggregator<T,R>public Aggregator<T,R> lookup(String fromCollection, String localField, String foreignField, String outputArray, List<Expr> pipeline, Map<String,Expr> let)
lookup in interface Aggregator<T,R>public Aggregator<T,R> merge(String intoDb, String intoCollection, Aggregator.MergeActionWhenMatched matchAction, Aggregator.MergeActionWhenNotMatched notMatchedAction, String... onFields)
merge in interface Aggregator<T,R>public Aggregator<T,R> merge(String intoCollection, Map<String,Expr> let, List<Map<String,Expr>> machedPipeline, Aggregator.MergeActionWhenNotMatched notMatchedAction, String... onFields)
merge in interface Aggregator<T,R>public Aggregator<T,R> merge(Class<?> intoCollection, Map<String,Expr> let, List<Map<String,Expr>> machedPipeline, Aggregator.MergeActionWhenMatched matchAction, Aggregator.MergeActionWhenNotMatched notMatchedAction, String... onFields)
merge in interface Aggregator<T,R>public Aggregator<T,R> merge(String intoDb, String intoCollection)
merge in interface Aggregator<T,R>public Aggregator<T,R> merge(Class<?> intoCollection)
merge in interface Aggregator<T,R>public Aggregator<T,R> merge(String intoCollection)
merge in interface Aggregator<T,R>public Aggregator<T,R> merge(String intoCollection, Aggregator.MergeActionWhenMatched matchAction, Aggregator.MergeActionWhenNotMatched notMatchedAction, String... onFields)
merge in interface Aggregator<T,R>public Aggregator<T,R> out(String collectionName)
out in interface Aggregator<T,R>public Aggregator<T,R> out(Class<?> type)
out in interface Aggregator<T,R>public Aggregator<T,R> out(String db, String collectionName)
out in interface Aggregator<T,R>public Aggregator<T,R> planCacheStats(Map<String,Object> param)
planCacheStats in interface Aggregator<T,R>public Aggregator<T,R> redact(Expr redact)
System 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.
redact in interface Aggregator<T,R>public Aggregator<T,R> replaceRoot(Expr newRoot)
replaceRoot in interface Aggregator<T,R>public Aggregator<T,R> replaceWith(Expr newDoc)
AggregatorreplaceWith in interface Aggregator<T,R>public Aggregator<T,R> sample(int sampleSize)
Aggregatorsample in interface Aggregator<T,R>public Aggregator<T,R> set(Map<String,Expr> param)
The $set stage is an alias for $addFields.
set in interface Aggregator<T,R>param - public Aggregator<T,R> sortByCount(Expr sortby)
{ $group: { _id:
sortByCount in interface Aggregator<T,R>sortby - public Aggregator<T,R> unionWith(String collection)
unionWith in interface Aggregator<T,R>public Aggregator<T,R> unionWith(Aggregator agg)
unionWith in interface Aggregator<T,R>public Aggregator<T,R> unset(List<String> field)
unset in interface Aggregator<T,R>public Aggregator<T,R> unset(String... param)
unset in interface Aggregator<T,R>public Aggregator<T,R> unset(Enum... field)
unset in interface Aggregator<T,R>public Aggregator<T,R> genericStage(String stageName, Object param)
genericStage in interface Aggregator<T,R>public Aggregator<T,R> collation(Collation collation)
collation in interface Aggregator<T,R>public List<Map<String,Object>> aggregateMap()
aggregateMap in interface Aggregator<T,R>Copyright © 2022. All rights reserved.