Skip to content

Commit

Permalink
mongodb: fix aggregation regex
Browse files Browse the repository at this point in the history
  • Loading branch information
imedina committed Dec 13, 2024
1 parent eb5b519 commit a073e84
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -783,7 +783,12 @@ private static List<Bson> createFacet(Bson query, List<String> facetFields) {
}

private static Facet getMongoDBFacet(String groupField, Accumulator accumulator, String accumulatorField, List<Double> boundaries) {
String accumulatorId = StringUtils.isNotEmpty(accumulatorField) ? "$" + accumulatorField : "$" + groupField;
String accumulatorId;
if (accumulator == count) {
accumulatorId = StringUtils.isNotEmpty(accumulatorField) ? "$" + accumulatorField : "1";
} else {
accumulatorId = StringUtils.isNotEmpty(accumulatorField) ? "$" + accumulatorField : "$" + groupField;
}

Facet facet;
switch (accumulator) {
Expand Down

0 comments on commit a073e84

Please sign in to comment.