Skip to content

Commit 11a2ef2

Browse files
committed
cleanup countAll
1 parent 13fc2ec commit 11a2ef2

File tree

3 files changed

+19
-44
lines changed

3 files changed

+19
-44
lines changed

google-cloud-firestore/src/main/java/com/google/cloud/firestore/pipeline/expressions/Count.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,9 @@ public final class Count extends Function implements Accumulator {
2727
Count(@Nonnull Expr value) {
2828
super("count", ImmutableList.of(value));
2929
}
30+
31+
@InternalApi
32+
Count() {
33+
super("count", ImmutableList.of());
34+
}
3035
}

google-cloud-firestore/src/main/java/com/google/cloud/firestore/pipeline/expressions/CountAll.java

Lines changed: 0 additions & 30 deletions
This file was deleted.

google-cloud-firestore/src/main/java/com/google/cloud/firestore/pipeline/expressions/Function.java

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3118,39 +3118,39 @@ public static Count count(String field) {
31183118
}
31193119

31203120
/**
3121-
* Creates an aggregation that counts the number of stage inputs that satisfy the provided filter
3122-
* condition.
3121+
* Creates an aggregation that counts the total number of stage inputs.
31233122
*
31243123
* <p>Example:
31253124
*
31263125
* <pre>{@code
3127-
* // Count the number of completed orders
3128-
* Function.countIf(Field.of("status").eq("completed")).as("completedOrderCount");
3126+
* // Count the total number of users
3127+
* Function.countAll().as("totalUsers");
31293128
* }</pre>
31303129
*
3131-
* @param condition The filter condition that needs to be met for the count to be incremented.
3132-
* @return A new {@code Accumulator} representing the 'countIf' aggregation.
3130+
* @return A new {@code Accumulator} representing the 'countAll' aggregation.
31333131
*/
31343132
@BetaApi
3135-
public static CountIf countIf(FilterCondition condition) {
3136-
return new CountIf(condition, false);
3133+
public static Count countAll() {
3134+
return new Count();
31373135
}
31383136

31393137
/**
3140-
* Creates an aggregation that counts the total number of stage inputs.
3138+
* Creates an aggregation that counts the number of stage inputs that satisfy the provided filter
3139+
* condition.
31413140
*
31423141
* <p>Example:
31433142
*
31443143
* <pre>{@code
3145-
* // Count the total number of users
3146-
* Function.countAll().as("totalUsers");
3144+
* // Count the number of completed orders
3145+
* Function.countIf(Field.of("status").eq("completed")).as("completedOrderCount");
31473146
* }</pre>
31483147
*
3149-
* @return A new {@code Accumulator} representing the 'countAll' aggregation.
3148+
* @param condition The filter condition that needs to be met for the count to be incremented.
3149+
* @return A new {@code Accumulator} representing the 'countIf' aggregation.
31503150
*/
31513151
@BetaApi
3152-
public static CountAll countAll() {
3153-
return new CountAll();
3152+
public static CountIf countIf(FilterCondition condition) {
3153+
return new CountIf(condition, false);
31543154
}
31553155

31563156
/**

0 commit comments

Comments
 (0)