export class Query {
constructor(name: string)
public readonly collectionName: string
where(condition: IQueryCondition): Query
orderBy(fieldPath: string, order: string): Query
limit(max: number): Query
skip(offset: number): Query
field(object: object): Query
get(options?: IGetDocumentOptions): Promise<IQueryResult> | void | string
update(options?: IUpdateDocumentOptions): Promise<IUpdateResult> | void
remove(options?: IRemoveDocumentOptions): Promise<IRemoveResult> | void
count(options?: ICountDocumentOptions): Promise<ICountResult> | void | string
}
这里的返回值能否使用泛型类似于
get<T>(options?: IGetDocumentOptions): Promise<T>
或者使用重载
get(options?: IGetDocumentOptions): Promise<IQueryResult>
get(options?: IGetDocumentOptions): void
get(options?: IGetDocumentOptions): string
因为现在使用Typescript的过程中无法通过检查