IFactsQuery
Service to query facts.
export interface IFactsQuery
Methods
Method | Description |
|---|---|
Starts the query. | |
Sets filter for the query. | |
Sets include for the query. | |
(BETA) Selects which backend endpoint flavor to use when listing facts. Default method: “GET” | |
Sets origin for the query. | |
Sets starting page for the query. Backend WILL return no data if the page is greater than total number of pages. Default page: 0 | |
Sets number of facts to return per page. Default size: 50 | |
Sets sorting for the query. |
Method details
IFactsQuery.query()method
Starts the query.
query(): Promise<IFactsQueryResult>;
Returns
Promise<IFactsQueryResult>
promise of first page of the results
IFactsQuery.withFilter()method
Sets filter for the query.
withFilter(filter: IFilterBaseOptions): IFactsQuery;
Parameters
Parameter | Type | Description |
|---|---|---|
filter | filter to apply |
Returns
facts query
IFactsQuery.withInclude()method
Sets include for the query.
withInclude(include: string[]): IFactsQuery;
Parameters
Parameter | Type | Description |
|---|---|---|
include | string[] | include to apply |
Returns
facts query
IFactsQuery.withMethod()methodBeta
Beta API. Mostly stable, but details may change in a minor release, outside SemVer.
Selects which backend endpoint flavor to use when listing facts. Default method: “GET”
withMethod(method: QueryMethod): IFactsQuery;
Parameters
Parameter | Type | Description |
|---|---|---|
method | endpoint flavor to use (“GET” or “POST”) |
Returns
facts query
IFactsQuery.withOrigin()method
Sets origin for the query.
withOrigin(origin: ObjectOrigin | (string & {})): IFactsQuery;
Parameters
Parameter | Type | Description |
|---|---|---|
origin | ObjectOrigin | (string & {}) | origin to apply. This is an open string union to allow platform-specific origin values in addition to the built-in literals. |
Returns
facts query
IFactsQuery.withPage()method
Sets starting page for the query. Backend WILL return no data if the page is greater than total number of pages. Default page: 0
withPage(page: number): IFactsQuery;
Parameters
Parameter | Type | Description |
|---|---|---|
page | number | zero indexed, must be non-negative |
Returns
facts query
IFactsQuery.withSize()method
Sets number of facts to return per page. Default size: 50
withSize(size: number): IFactsQuery;
Parameters
Parameter | Type | Description |
|---|---|---|
size | number | desired max number of facts per page must be a positive number |
Returns
facts query
IFactsQuery.withSorting()method
Sets sorting for the query.
withSorting(sort: string[]): IFactsQuery;
Parameters
Parameter | Type | Description |
|---|---|---|
sort | string[] | Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported. |
Returns
facts query