File tree 1 file changed +15
-1
lines changed
packages/firestore-compat/src
1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -22,8 +22,11 @@ import {
22
22
Firestore as FirestoreExp ,
23
23
FirestoreError ,
24
24
_EmptyAuthCredentialsProvider ,
25
- _EmptyAppCheckTokenProvider
25
+ _EmptyAppCheckTokenProvider ,
26
+ Query as ExpQuery ,
27
+ getCountFromServer
26
28
} from '@firebase/firestore' ;
29
+ import { Compat } from '@firebase/util' ;
27
30
28
31
import {
29
32
Firestore as FirestoreCompat ,
@@ -98,6 +101,17 @@ export class Firestore extends FirestoreCompat {
98
101
new MemoryPersistenceProvider ( )
99
102
) ;
100
103
}
104
+
105
+ INTERNAL = {
106
+ delete : ( ) => this . terminate ( ) ,
107
+ count : ( query : Compat < ExpQuery < unknown > > ) => {
108
+ return getCountFromServer ( query . _delegate )
109
+ . then ( response => {
110
+ return response . data ( ) . count ;
111
+ } )
112
+ . catch ( error => Promise . reject ( error ) ) ;
113
+ }
114
+ } ;
101
115
}
102
116
103
117
function databaseIdFromFirestoreDatabase (
You can’t perform that action at this time.
0 commit comments