Represents a single match of a DQL query, similar to a “row” in SQL terms. It’s a reference type serving as a “cursor”, allowing for efficient access of the underlying data in various formats.

The value property is lazily materialized and kept in memory until it goes out of scope. To reduce the memory footprint, structure your code such that items can be processed as a stream, i.e. one by one (or in batches) and dematerialize() them right after use.

Hierarchy

  • QueryResultItem

Accessors

  • get isMaterialized(): boolean
  • Returns true if value is currently held materialized in memory, otherwise returns false.

    See materialize() and dematerialize().

    Returns boolean

  • get value(): any
  • Returns the content as a materialized object.

    The item's value is materialized() on first access and subsequently on each access after performing dematerialize() . Once materialized, the value is kept in memory until explicitly dematerialize() -ed or the item goes out of scope.

    Note: This property is very similar to value.

    Returns any

Methods

  • Returns the content of the item as CBOR data.

    Important: The returned CBOR data is not cached, make sure to call this method once and keep it for as long as needed.

    Returns Uint8Array

  • Releases the materialized value from memory. No-op if item is not materialized.

    Returns void

  • Returns the content of the item as a JSON string.

    Important: The returned JSON string is not cached, make sure to call this method once and keep it for as long as needed.

    Returns string

  • Loads the CBOR representation of the item's content, decodes it as an object so it can be accessed via value . Keeps the object in memory until dematerialize() is called. No-op if value is already materialized.

    Returns void