Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace query

Index

Type aliases

CompleteCallback: () => any

Type declaration

    • (): any
    • This callback is called when the network connection is closed (e.g. because of network timeout or lost Wi-Fi connection)

      Returns any

CountCallback: (count: number) => Promise<any> | any

Type declaration

    • (count: number): Promise<any> | any
    • The count callback is called, when the asynchronous query operation completes successfully

      Parameters

      • count: number

        the matching object count

      Returns Promise<any> | any

      A Promise, result or undefined

EventStreamOptions: { initial?: boolean; matchTypes?: "all" | MatchType[]; operations?: "any" | Operation[]; reconnects?: number }
param initial

Indicates whether or not the initial result set should be delivered on creating the subscription.

param matchTypes

A list of match types.

param operations

A list of operations.

param reconnects

The number of reconnects.

Type declaration

  • Optional initial?: boolean
  • Optional matchTypes?: "all" | MatchType[]
  • Optional operations?: "any" | Operation[]
  • Optional reconnects?: number
FailCallback: (error: error.PersistentError) => Promise<any> | any

Type declaration

    • The fail callback is called, when the asynchronous query operation is rejected by an error

      Parameters

      Returns Promise<any> | any

      A Promise, result or undefined

FilterObject: {}

Type declaration

  • [key: string]: NestedFilter | Json | Entity | Date
MatchType: "match" | "add" | "change" | "changeIndex" | "remove"
NextEventCallback<T>: (event: RealtimeEvent<T>) => Promise<any> | any

Type parameters

Type declaration

    • This callback is called whenever the result of the real-time query changes. The received event contains information on how the query result changed.

      Parameters

      Returns Promise<any> | any

NextResultCallback<T>: (result: T[]) => any

Type parameters

  • T

Type declaration

    • (result: T[]): any
    • This callback is called whenever the result of the real-time query changes. The full result set is received.

      Parameters

      • result: T[]

        The updated real-time query result

      Returns any

Operation: "insert" | "update" | "delete" | "none"
RealtimeEvent<T>: { data: T; date: Date; index?: number; initial: boolean; matchType: MatchType; operation: Operation }

An event for a real-time query.

Type parameters

Type declaration

  • data: T

    the database entity this event was generated for, e.g. an entity that just entered or left the result set, or an array of entities, if this event type is an initial result

  • date: Date

    server-time from the instant at which the event was generated

  • Optional index?: number

    for sorting queries only: the position of the matching entity in the ordered result (-1 for non-matching entities)

  • initial: boolean

    a boolean value indicating whether this event reflects the matching status at query time (true) or a recent change data change (false)

  • matchType: MatchType

    indicates how the transmitted entity relates to the query result. Every event is delivered with one of the following match types:

    • 'match': the entity matches the query.
    • 'add': the entity entered the result set, i.e. it did not match before and is matching now.
    • 'change': the entity was updated, but remains a match
    • 'changeIndex' (for sorting queries only): the entity was updated and remains a match, but changed its position within the query result
    • 'remove': the entity was a match before, but is not matching any longer
  • operation: Operation

    the operation by which the entity was altered 'none' if unknown or not applicable

ResultListCallback<T>: (result: T[]) => Promise<any> | any

Type parameters

  • T

Type declaration

    • (result: T[]): Promise<any> | any
    • The resultList callback is called, when the asynchronous query operation completes successfully

      Parameters

      • result: T[]

        The query result list, an empty list if no match was found

      Returns Promise<any> | any

      A Promise, result or undefined

ResultOptions: { depth?: number | boolean }

Type declaration

  • Optional depth?: number | boolean
ResultStreamOptions: { reconnects?: number }

Type declaration

  • Optional reconnects?: number
SingleResultCallback<T>: (entity: T | null) => Promise<any> | any

Type parameters

  • T

Type declaration

    • (entity: T | null): Promise<any> | any
    • The singleResult callback is called, when the asynchronous query operation completes successfully

      Parameters

      • entity: T | null

        The matching object or null id no matching object was found

      Returns Promise<any> | any

      A Promise, result or undefined

Variables

Condition: Partial<query.Condition<any>>

Functions

  • flatArgs(args: any[]): any[]
  • Parameters

    • args: any[]

    Returns any[]

Generated using TypeDoc