Mila/count add api interface#6499
Conversation
|
| @@ -17,6 +17,30 @@ export type AddPrefixToKeys<Prefix extends string, T extends Record<string, unkn | |||
| [K in keyof T & string as `${Prefix}.${K}`]+?: T[K]; | |||
| }; | |||
|
|
|||
There was a problem hiding this comment.
auto-updated file by API Extractor
| import {DocumentData, Query, queryEqual} from './reference'; | ||
|
|
||
|
|
||
| export class AggregateQuery<T = DocumentData>{ |
There was a problem hiding this comment.
created class only, hasn't implement the internal methods
Size Report 1Affected Products
Test Logs |
Size Analysis Report 1This report is too large (134,688 characters) to be displayed here in a GitHub comment. Please use the below link to see the full report on Google Cloud Storage.Test Logs |
| query | ||
| } from '../util/firebase_export'; | ||
| import { apiDescribe, withTestCollection } from '../util/helpers'; | ||
|
|
There was a problem hiding this comment.
both tests will fail as the count API internal logic is not implemented yet, and only returning 42 as dummy count.
This count query interface is implemented based on the COUNT Query API proposal.
Based on the demo provided:
countQueryfunction will accept a collection or query referencecountQuerywill create aaggregateQueryinstance, and return it. (class AggregateQuery)getAggregateFromServerDirectfunction will take aggregateQuery object, createAggregateQuerySnapshotinstance, and return a promiseAggregateQuerySnapshotobject hasgetCountpublic method to access the document count