Options
All
  • Public
  • Public/Protected
  • All
Menu

Class QueryExpression<TReturns>

Represents a sensenet Content Query expression

Type parameters

Hierarchy

Index

Constructors

constructor

Properties

Protected _queryRef

_queryRef: Query<TReturns>

Protected _stringValue

_stringValue: string

Methods

Between

  • Between<K>(fieldName: K, minValue: TReturns[K], maxValue: TReturns[K], minimumInclusive?: boolean, maximumInclusive?: boolean): QueryOperators<TReturns>
  • Range search query expression

    Type parameters

    • K: keyof TReturns

    Parameters

    • fieldName: K

      he name of the Field to be checked

    • minValue: TReturns[K]

      The minimum allowed value

    • maxValue: TReturns[K]

      The maximum allowed value

    • Default value minimumInclusive: boolean = false

      Lower limit will be inclusive / exclusive

    • Default value maximumInclusive: boolean = false

      Upper limit will be inclusive / exclusive

    Returns QueryOperators<TReturns>

Equals

  • Equals<K>(fieldName: K | "_Text", value: TReturns[K]): QueryOperators<TReturns>
  • Field equality check content query expression (e.g. +FieldName:'value')

    Type parameters

    • K: keyof TReturns

    Parameters

    • fieldName: K | "_Text"
    • value: TReturns[K]

      The value that will be checked. You can use '?' and '*' wildcards

    Returns QueryOperators<TReturns>

    The Next query operator (fluent)

GreatherThan

  • GreatherThan<K>(fieldName: K, minValue: TReturns[K], minimumInclusive?: boolean): QueryOperators<TReturns>
  • Greather than query expression (+FieldName:>'value')

    Type parameters

    • K: keyof TReturns

    Parameters

    • fieldName: K

      he name of the Field to be checked

    • minValue: TReturns[K]

      The minimum allowed value

    • Default value minimumInclusive: boolean = false

      Lower limit will be inclusive / exclusive

    Returns QueryOperators<TReturns>

InFolder

  • Adds an InFolder content query expression

    Parameters

    • path: string | SavedContent

      The path string or content that will be used as a root

    Returns QueryOperators<TReturns>

    The Next query operator (fluent)

InTree

  • Adds an InTree content query expression

    Parameters

    • path: string | SavedContent

      The path string or content that will be used as a root

    Returns QueryOperators<TReturns>

    The Next query operator (fluent)

LessThan

  • LessThan<K>(fieldName: K, maxValue: TReturns[K], maximumInclusive?: boolean): QueryOperators<TReturns>
  • Less than query expression (+FieldName:<'value')

    Type parameters

    • K: keyof TReturns

    Parameters

    • fieldName: K

      he name of the Field to be checked

    • maxValue: TReturns[K]

      The maximum allowed value

    • Default value maximumInclusive: boolean = false

      Upper limit will be inclusive / exclusive

    Returns QueryOperators<TReturns>

Not

NotEquals

  • NotEquals<K>(fieldName: K, value: TReturns[K]): QueryOperators<TReturns>
  • Field equality and NOT operator combination. (e.g. +NOT(FieldName:'value'))

    Type parameters

    • K: keyof TReturns

    Parameters

    • fieldName: K
    • value: TReturns[K]

      The value that will be checked. You can use '?' and '*' wildcards

    Returns QueryOperators<TReturns>

    The Next query operator (fluent)

Query

Skip

  • Adds a '.SKIP' Content Query segment

    Parameters

    • skipCount: number

      Items to skip

    Returns QuerySegment<TReturns>

Sort

  • Sort<K>(field: K, reverse?: boolean): QuerySegment<TReturns>
  • A '.SORT' Content Query segment

    Type parameters

    • K: keyof TReturns

    Parameters

    • field: K

      The name of the field

    • Default value reverse: boolean = false

      Sort in reverse order, false by default

    Returns QuerySegment<TReturns>

Term

  • A plain string as Query term

    Parameters

    • term: string

      The Query term

    Returns QueryOperators<TReturns>

    The Next query operator (fluent)

Top

  • A '.TOP' Content Query segment

    Parameters

    • topCount: number

      The TOP item count

    Returns QuerySegment<TReturns>

Type

  • Adds a Type content query expression and casts the rest of the expression to a new type

    Type parameters

    Parameters

    • newTypeAssertion: object

      The path string or content that will be used as a root

      • constructor: function
        • new __type(...args: any[]): TNewType
        • Parameters

          • Rest ...args: any[]

          Returns TNewType

    Returns QueryOperators<TNewType>

    The Next query operator (fluent)

TypeIs

  • TypeIs<TNewType>(newTypeAssertion: object): QueryOperators<TNewType>
  • Adds a TypeIs content query expression and casts the rest of the expression to a new type

    Type parameters

    Parameters

    • newTypeAssertion: object

      The path string or content that will be used as a root

      • constructor: function
        • new __type(...args: any[]): TNewType
        • Parameters

          • Rest ...args: any[]

          Returns TNewType

    Returns QueryOperators<TNewType>

    The Next query operator (fluent)

Protected escapeValue

  • escapeValue(value: string): string
  • Escapes a String value (except '?' and '*' characters for wildcards)

    Parameters

    • value: string

      The String value to be escaped

    Returns string

    The escaped value

Protected finialize

  • Type parameters

    Returns QueryOperators<TReturnsExtended>

Protected finializeSegment

toString

  • toString(): string
  • Returns string

    a segment string value

Generated using TypeDoc