@squidcloud/client
    Preparing search index...

    Class DereferencedJoin<Aliases, ReturnType, RootAlias, LatestAlias>

    A join query result that has been grouped by alias and returns the DocumentData.

    Type Parameters

    Implements

    Index

    Methods

    • Adds multiple conditions that are combined with an AND operator.

      Parameters

      • conditions: SimpleCondition<
            any,
            string,
            | "in"
            | "not in"
            | "array_includes_some"
            | "array_includes_all"
            | "array_not_includes"
            | "=="
            | "!="
            | ">="
            | "<="
            | ">"
            | "<"
            | "like"
            | "not like"
            | "like_cs"
            | "not like_cs",
        >[]

        An array of conditions to be applied together.

      Returns DereferencedJoin<Aliases, ReturnType, RootAlias, LatestAlias>

      The updated query builder.

    • Extracts the root document's data from the given join result.

      Parameters

      • data: ReturnType

        A record containing document references.

      Returns any

      The root document's data.

    • @internal/

      Returns number

    • Returns the current sort orders applied to the query.

      Returns FieldSort<any>[]

      An array of field sort definitions.

    • Transforms this join query result to a nested data structure. For example, a join between teachers and students normally returns a result of the form: [ { teacher: {name: 'Mr. Smith'}, student: {name: 'John Doe'} }, { teacher: {name: 'Mr. Smith'}, student: {name: 'Jane Smith'} }, { teacher: {name: 'Mr. EmptyClass'}, student: undefined }, ] into a result of the form: [ { teacher: {name: 'Mr. Smith'}, students: [ { name: 'John Doe' }, { name: 'Jane Smith' }, ]}, { teacher: {name: 'Mr. EmptyClass'}, students: [] }, ]

      Returns SnapshotEmitter<Grouped<Aliases, ReturnType, RootAlias>>

    • Returns the results of the query based on the data that is currently available on the client. This method is useful for synchronously accessing data that has already been fetched by another query. The method will return an empty array if data has not yet been populated.

      Returns ReturnType[]

      An array of query results.

    • Returns an observable that emits the query results and updates whenever the query results change unless subscribe=false is provided.

      Important: Make sure to unsubscribe from the observable when you are done with it.

      Parameters

      • Optionalsubscribe: boolean

        Whether to subscribe to changes to the query results. Defaults to true.

      Returns Observable<ReturnType[]>

      An observable for the query results.