Query class
Query allows to build queries to be used to fetch data from a model.
Signature:
export declare class Query implements QueryJSON
Implements: QueryJSON
Constructors
Constructor | Modifiers | Description |
---|---|---|
(constructor)(ands, ors, sort) | Query creates a new generic query object. |
Properties
Property | Modifiers | Type | Description |
---|---|---|---|
ands | CriterionJSON[] | ||
index? | string | (Optional) | |
limit? | number | (Optional) | |
ors | QueryJSON[] | ||
seek? | string | (Optional) | |
skip? | number | (Optional) | |
sort? | SortJSON | undefined | (Optional) |
Methods
Method | Modifiers | Description |
---|---|---|
and(fieldPath) | and concatenates a new condition in an existing field. | |
limitTo(limit) | limitTo sets the maximum number of results. | |
or(query) | or concatenates a new condition that is sufficient for an instance to satisfy, independent of the current Query. Has left-associativity as: (a And b) Or c | |
orderBy(fieldPath) | orderBy specify ascending order for the query results. On multiple calls, only the last one is considered. | |
orderByDesc(fieldPath) | orderByDesc specify descending order for the query results. On multiple calls, only the last one is considered. | |
orderByID() | orderByID specifies ascending ID order for the query results. On multiple calls, only the last one is considered. | |
orderByIDDesc() | orderByIDDesc specifies descending ID order for the query results. On multiple calls, only the last one is considered. | |
seekID(id) | seekID seeks to the given ID before returning query results. | |
skipNum(num) | skipNum skips the given number of results. | |
useIndex(fieldPath) | useIndex specifies the index to use when running this query. | |
where(fieldPath) | static | where starts to create a query condition for a field |