Class: QueryBuilder

QueryBuilder(entitynon-null, queryFactorynon-null)

A builder for creating `Query` instances. A more flexible approach to query creation than using a `QueryFactory`.

Constructor

new QueryBuilder(entitynon-null, queryFactorynon-null)

Parameters:
Name Type Description
entity Class.<Message> a Protobuf type of the query target entities
queryFactory QueryFactory
Source:

Extends

Methods

build() → {Query}

Creates the Query instance based on the current builder configuration.
Source:
Returns:
a new query
Type
Query

limit(limit)

Limits the query response to the given number of entities. The value must be non-negative, otherwise an error occurs. If set to `0`, all the available entities are retrieved. When set, the result ordering must also be specified.
Parameters:
Name Type Description
limit number the max number of response entities
Source:

orderAscendingBy(column)

Requests the query results to be ordered by the given `column` in the ascending direction. Whether the results will be sorted in the requested order depends on the implementation of server-side communication. For example, the Firebase-based communication protocol does not preserve ordering. Regardless, if a `limit` is set for a query, an ordering is also required.
Parameters:
Name Type Description
column
Source:

orderDescendingBy(column)

Requests the query results to be ordered by the given `column` in the descending direction. Whether the results will be sorted in the requested order depends on the implementation of server-side communication. For example, the Firebase-based communication protocol does not preserve ordering. Regardless, if a `limit` is set for a query, an ordering is also required.
Parameters:
Name Type Description
column
Source: