QuerySingle <T>
Index
Constructors
Methods
Constructors
constructor
Type parameters
- T: CloudObject<T>
Returns QuerySingle<T>
Methods
cast
See Query.cast()
Type parameters
- S: CloudObject<S>
Parameters
type: Class<S>
the new type
Returns QuerySingle<S>
query single on a node of the specified type
execute
Execute the query single, see Query.execute()
Returns Promise<T>
promise containing the single result or
null
executeFromCache
Execute the query single on the local data cloud, see Query.executeFromCache()
Returns T
single result value or
null
follow
Follow a 0..1 relation See Query.follow()
Type parameters
- D: CloudObject<D>
Parameters
relation: Relation<T, D>
relation to next node
Returns QuerySingle<D>
new query single with follow operation
staticfrom
Create a
query single
from a single node. See Query.fromType parameters
- T: CloudObject<T>
Parameters
object: InstanceOrTag
starting node for the graph query single
Returns QuerySingle<T>
new query single only accepting 0..1 relations
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.