@squidcloud/client
    Preparing search index...

    Class BaseQueryBuilder<MyDocType>Abstract

    Query builder base class.

    Type Parameters

    Hierarchy (View Summary)

    Index

    Constructors

    Methods

    • Adds a condition to the query to check if the specified field includes all the given values.

      Parameters

      • fieldName: string | keyof MyDocType & string

        The name of the field to query.

      • values: PrimitiveFieldType[]

        The values to check for inclusion in the field array.

      Returns this

      The query builder.

    • Adds a condition to the query to check if the specified field includes any of the given values.

      Parameters

      • fieldName: string | keyof MyDocType & string

        The name of the field to query.

      • values: PrimitiveFieldType[]

        The values to check for inclusion in the field array.

      Returns this

      The query builder.

    • Adds a condition to the query to check if the specified field does not include any of the given values.

      Parameters

      • fieldName: string | keyof MyDocType & string

        The name of the field to query.

      • values: PrimitiveFieldType[]

        The values to check for non-inclusion in the field array.

      Returns this

      The query builder.

    • Returns the query object built by this query builder.

      Returns Query

    • A shortcut for where(fieldName, '==', value)

      Parameters

      Returns this

      The query builder.

    • A shortcut for where(fieldName, '>', value)

      Parameters

      Returns this

      The query builder.

    • A shortcut for where(fieldName, '>=', value)

      Parameters

      Returns this

      The query builder.

    • A shortcut for where(fieldName, 'in', value)

      Parameters

      • fieldName: string | keyof MyDocType & string

        The name of the field to query.

      • value: PrimitiveFieldType[]

        An array of values to compare against.

      Returns this

      The query builder.

    • A shortcut for where(fieldName, 'like', pattern).

      Parameters

      • fieldName: string | keyof MyDocType & string

        The name of the field to query.

      • pattern: string

        The pattern to compare against. '%' matches 0 or more characters. '' matches exactly one character. '' can be used to escape '%', ''. or another ''. Note that any '' that is not followed by '%', '_', or '' is invalid.

      • OptionalcaseSensitive: boolean

        Whether to use case-sensitive comparison. Defaults to true.

      Returns this

      The query builder.

    • Sets a limit to the number of results returned by the query. The maximum limit is 20,000 and the default is 1,000 if none is provided.

      Parameters

      • limit: number

        The limit to set.

      Returns this

      The query builder.

    • A shortcut for where(fieldName, '<', value)

      Parameters

      Returns this

      The query builder.

    • A shortcut for where(fieldName, '<=', value)

      Parameters

      Returns this

      The query builder.

    • A shortcut for where(fieldName, '!=', value)

      Parameters

      Returns this

      The query builder.

    • A shortcut for where(fieldName, 'not in', value)

      Parameters

      • fieldName: string | keyof MyDocType & string

        The name of the field to query.

      • value: PrimitiveFieldType[]

        An array of values to compare against.

      Returns this

      The query builder.

    • A shortcut for where(fieldName, 'not like', pattern).

      Parameters

      • fieldName: string | keyof MyDocType & string

        The name of the field to query.

      • pattern: string

        The pattern to compare against. '%' matches 0 or more characters. '' matches exactly one character. '' can be used to escape '%', ''. or another ''. Note that any '' that is not followed by '%', '_', or '' is invalid.

      • OptionalcaseSensitive: boolean

        Whether to use case-sensitive comparison. Defaults to true.

      Returns this

      The query builder.

    • Adds a sort order to the query. You can add multiple sort orders to the query. The order in which you add them determines the order in which they are applied.

      Parameters

      • fieldName: string | keyof MyDocType & string

        The name of the field to sort by.

      • Optionalasc: boolean

        Whether to sort in ascending order. Defaults to true.

      Returns this

      The query builder.

    • Adds a condition to the query.

      Parameters

      • fieldName: string | keyof MyDocType & string

        The name of the field to query.

      • operator:
            | "in"
            | "not in"
            | "array_includes_some"
            | "array_includes_all"
            | "array_not_includes"
            | "=="
            | "!="
            | ">="
            | "<="
            | ">"
            | "<"
            | "like"
            | "not like"
            | "like_cs"
            | "not like_cs"

        The operator to use.

      • value: PrimitiveFieldType | PrimitiveFieldType[]

        The value to compare against.

      Returns this

      The query builder.