Skip to content

Commit

Permalink
mongodb: aggregation test 2. To be reverted.
Browse files Browse the repository at this point in the history
  • Loading branch information
imedina committed Dec 13, 2024
1 parent 31424d8 commit 57f2138
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -782,7 +782,13 @@ private static Facet getMongoDBFacet(String field, Accumulator accumulator, List
switch (accumulator) {
case count: {
// facet = new Facet(field + COUNTS_SUFFIX, Arrays.asList(Aggregates.group(id, Accumulators.sum(count.name(), 1))));
facet = new Facet(field + COUNTS_SUFFIX, Arrays.asList(Aggregates.group(id, Accumulators.sum(count.name(), "$size"))));
facet = new Facet(field + COUNTS_SUFFIX,
Arrays.asList(Aggregates.group(
id,
Accumulators.sum(count.name(), 1),
Accumulators.sum("size", "$size"),
Accumulators.avg("avg", "$size")
)));
break;
}
case sum: {
Expand Down

0 comments on commit 57f2138

Please sign in to comment.