@dxos/client
    Preparing search index...

    Interface Query<T>

    interface Query<T> {
        "~Query": { value: T };
        ast:
            | QuerySelectClause
            | QueryFilterClause
            | QueryReferenceTraversalClause
            | QueryIncomingReferencesClause
            | QueryRelationClause
            | QueryRelationTraversalClause
            | QueryUnionClause
            | QueryOptionsClause;
        options(options: QueryOptions): Query<T>;
        reference<K extends string>(key: K): Query<Target<T[K]>>;
        referencedBy<S extends All>(
            target: S,
            key: RefPropKey<Type<S>>,
        ): Query<Type<S>>;
        select(filter: Filter<T>): Query<T>;
        select(props: Props<T>): Query<T>;
        source(): Query<RelationSource<T>>;
        sourceOf<S extends All>(
            relation: S,
            predicates?: Props<Type<S>>,
        ): Query<Type<S>>;
        target(): Query<RelationTarget<T>>;
        targetOf<S extends All>(
            relation: S,
            predicates?: Props<Type<S>>,
        ): Query<Type<S>>;
    }

    Type Parameters

    • T
    Index

    Properties

    "~Query": { value: T }
    ast:
        | QuerySelectClause
        | QueryFilterClause
        | QueryReferenceTraversalClause
        | QueryIncomingReferencesClause
        | QueryRelationClause
        | QueryRelationTraversalClause
        | QueryUnionClause
        | QueryOptionsClause

    Methods

    • Add options to a query.

      Parameters

      • options: QueryOptions

      Returns Query<T>

    • Traverse an outgoing reference.

      Type Parameters

      • K extends string

      Parameters

      • key: K

        Property path inside T that is a reference.

      Returns Query<Target<T[K]>>

      Query for the target of the reference.

    • Find objects referencing this object.

      Type Parameters

      • S extends All

      Parameters

      • target: S

        Schema of the referencing object.

      • key: RefPropKey<Type<S>>

        Property path inside the referencing object that is a reference.

      Returns Query<Type<S>>

      Query for the referencing objects.

    • Filter the current selection based on a filter.

      Parameters

      • filter: Filter<T>

        Filter to select the objects.

      Returns Query<T>

      Query for the selected objects.

    • Parameters

      Returns Query<T>

    • For a query for relations, get the source objects.

      Returns Query<RelationSource<T>>

      Query for the source objects.

    • Find relations where this object is the source.

      Type Parameters

      • S extends All

      Parameters

      • relation: S

        Schema of the relation.

      • Optionalpredicates: Props<Type<S>>

        Predicates to filter the relation objects.

      Returns Query<Type<S>>

      Query for the relation objects.

    • For a query for relations, get the target objects.

      Returns Query<RelationTarget<T>>

      Query for the target objects.

    • Find relations where this object is the target.

      Type Parameters

      • S extends All

      Parameters

      • relation: S

        Schema of the relation.

      • Optionalpredicates: Props<Type<S>>

        Predicates to filter the relation objects.

      Returns Query<Type<S>>

      Query for the relation objects.