Options
All
  • Public
  • Public/Protected
  • All
Menu

Query allows to build queries to be used to fetch data from a model.

Hierarchy

  • Query

Implements

Index

Constructors

Properties

Methods

Constructors

constructor

  • Query creates a new generic query object.

    Parameters

    • Default value ands: CriterionJSON[] = []

      An array of top-level Criterions to be included in the query.

    • Default value ors: QueryJSON[] = []

      An array of internal queries.

    • Optional sort: SortJSON

      An object describing how to sort the query.

    Returns Query

Properties

ands

An array of top-level Criterions to be included in the query.

ors

ors: QueryJSON[]

An array of internal queries.

Optional sort

sort: SortJSON

An object describing how to sort the query.

Methods

and

  • and concatenates a new condition in an existing field.

    Parameters

    • fieldPath: string

      The field name to query on. Can be a hierarchical path.

    Returns Criterion

or

  • or concatenates a new condition that is sufficient for an instance to satisfy, independant of the current Query. Has left-associativity as: (a And b) Or c

    Parameters

    • query: Query

      The 'sub-query' to concat to the existing query.

    Returns Query

orderBy

  • orderBy(fieldPath: string): Query
  • orderBy specify ascending order for the query results. On multiple calls, only the last one is considered.

    Parameters

    • fieldPath: string

      The field name to query on. Can be a hierarchical path.

    Returns Query

orderByDesc

  • orderByDesc(fieldPath: string): Query
  • orderByDesc specify descending order for the query results. On multiple calls, only the last one is considered.

    Parameters

    • fieldPath: string

      The field name to query on. Can be a hierarchical path.

    Returns Query

Static where

  • where starts to create a query condition for a field

    Parameters

    • fieldPath: string

      The field name to query on. Can be a hierarchical path.

    Returns Criterion