Skip to content

Commit 965144b

Browse files
committed
Collapse CountQuery.java into AggregateQuery.java for simplicity
1 parent 01420e4 commit 965144b

File tree

2 files changed

+5
-40
lines changed

2 files changed

+5
-40
lines changed

firebase-firestore/src/main/java/com/google/firebase/firestore/AggregateQuery.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,13 @@
1414

1515
package com.google.firebase.firestore;
1616

17-
import android.app.Activity;
1817
import androidx.annotation.NonNull;
1918

20-
import com.google.android.gms.tasks.Continuation;
2119
import com.google.android.gms.tasks.Task;
2220
import com.google.android.gms.tasks.TaskCompletionSource;
23-
import com.google.firebase.firestore.core.CountQuery;
21+
import com.google.firebase.firestore.remote.Datastore;
2422
import com.google.firebase.firestore.util.Executors;
2523

26-
import java.util.concurrent.Executor;
27-
2824
public final class AggregateQuery {
2925

3026
private final Query query;
@@ -43,10 +39,12 @@ public Query getQuery() {
4339

4440
@NonNull
4541
public Task<AggregateQuerySnapshot> get() {
46-
CountQuery countQuery = new CountQuery(query.firestore.getClient().getDatastore(), query.query);
42+
Datastore datastore = query.firestore.getClient().getDatastore();
4743
TaskCompletionSource<AggregateQuerySnapshot> tcs = new TaskCompletionSource<>();
4844

49-
countQuery.run().continueWith(Executors.DIRECT_EXECUTOR, task -> {
45+
datastore
46+
.runCountQuery(query.query.toTarget())
47+
.continueWith(Executors.DIRECT_EXECUTOR, task -> {
5048
if (task.isSuccessful()) {
5149
tcs.setResult(new AggregateQuerySnapshot(task.getResult()));
5250
} else {

firebase-firestore/src/main/java/com/google/firebase/firestore/core/CountQuery.java

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

0 commit comments

Comments
 (0)