Skip to main content
Version: 2.9

QuerySingle <T>

A QuerySingle is a Query which follows relations that should be unique between data types (0..1 and 1..1 cardinalities). It returns the instance related to the origin, following the specified relation(s).

It acts as a syntactic sugar to avoid having a query result structure and get the first value out of it.

A QuerySingle is immutable.

Index

Constructors

constructor

Methods

cast

execute

  • execute(): Promise<T>
  • Execute the query single, see Query.execute()


    Returns Promise<T>

    promise containing the single result or null

executeFromCache

  • executeFromCache(): T

follow

staticfrom

  • Create a query single from a single node. See Query.from


    Type parameters

    Parameters

    Returns QuerySingle<T>

    new query single only accepting 0..1 relations