File tree Expand file tree Collapse file tree 2 files changed +5
-40
lines changed
firebase-firestore/src/main/java/com/google/firebase/firestore Expand file tree Collapse file tree 2 files changed +5
-40
lines changed Original file line number Diff line number Diff line change 14
14
15
15
package com .google .firebase .firestore ;
16
16
17
- import android .app .Activity ;
18
17
import androidx .annotation .NonNull ;
19
18
20
- import com .google .android .gms .tasks .Continuation ;
21
19
import com .google .android .gms .tasks .Task ;
22
20
import com .google .android .gms .tasks .TaskCompletionSource ;
23
- import com .google .firebase .firestore .core . CountQuery ;
21
+ import com .google .firebase .firestore .remote . Datastore ;
24
22
import com .google .firebase .firestore .util .Executors ;
25
23
26
- import java .util .concurrent .Executor ;
27
-
28
24
public final class AggregateQuery {
29
25
30
26
private final Query query ;
@@ -43,10 +39,12 @@ public Query getQuery() {
43
39
44
40
@ NonNull
45
41
public Task <AggregateQuerySnapshot > get () {
46
- CountQuery countQuery = new CountQuery ( query .firestore .getClient ().getDatastore (), query . query );
42
+ Datastore datastore = query .firestore .getClient ().getDatastore ();
47
43
TaskCompletionSource <AggregateQuerySnapshot > tcs = new TaskCompletionSource <>();
48
44
49
- countQuery .run ().continueWith (Executors .DIRECT_EXECUTOR , task -> {
45
+ datastore
46
+ .runCountQuery (query .query .toTarget ())
47
+ .continueWith (Executors .DIRECT_EXECUTOR , task -> {
50
48
if (task .isSuccessful ()) {
51
49
tcs .setResult (new AggregateQuerySnapshot (task .getResult ()));
52
50
} else {
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments