Interface QueryContract<DocumentType>
Methods
[asyncIterator]
- [asyncIterator](): AsyncIterableIterator<DocumentType>
Returns AsyncIterableIterator<DocumentType>
all
- all(): Promise<DocumentType[]>
Returns Promise<DocumentType[]>
count
- count(): Promise<number>
Returns Promise<number>
distinct
- distinct<T>(key): Promise<T[]>
Returns Promise<T[]>
explain
- explain(verbosity?): Promise<Document>
Parameters
Optional
verbosity: ExplainVerbosityLike
Returns Promise<Document>
first
- first(): Promise<null | DocumentType>
Returns Promise<null | DocumentType>
firstOrFail
- firstOrFail(): Promise<DocumentType>
Returns Promise<DocumentType>
sortBy
- sortBy(field, direction?): QueryContract<DocumentType>
Parameters
field: string
Optional
direction: SortDirection
Returns an iterator on all matching documents.