Record represents an entry in the result of a query

Constructors

  • This constructor should not be called directly

    Parameters

    • variables: string[]

      the variables of the query

    • values: any[]

      the values of the record

    • variableToIndex: {
          [key: string]: number;
      }

      a map from variable to index

      • [key: string]: number

    Returns Record

Properties

_values: any[]
_variableToIndex: {
    [variable: string]: number;
}

Type declaration

  • [variable: string]: number
_variables: string[]
length: number

Methods

  • Iterate over all values. Equivalent to record.values()

    Returns IterableIterator<any>

    an iterable over all values

  • Iterate over all entries (key, value)

    Returns IterableIterator<[string, any]>

    an iterable over all entries

  • Get the value associated with the key in the record

    Parameters

    • key: string | number

      the variable name or its index emmited by the onVariables event

    Returns any

    the value associated with the key

  • Check if the record has a value associated with the key

    Parameters

    • key: string | number

      the variable name or its index emmited by the onVariables event

    Returns boolean

    true if the record has a value associated with the key

  • Convert the record to an Object

    Returns Object

    the record as an Object

  • Iterate over all values

    Returns IterableIterator<any>

    an iterable over all values