Class HFilterBuilder

Used to build Haystack Filter strings.

const filter = new HFilterBuilder()
.has('site')
.and()
.equals('geoCity', 'Las Vegas')
.build()

Hierarchy

  • HFilterBuilder

Constructors

Properties

_isHFilterBuilder: true = true

Used for a type guard check.

Accessors

  • get internalBuffer(): string
  • The internal buffer used to build the haystack filter.

    Please note, this method is only intended for debugging/testing purposes.

    Returns string

Methods

  • Validate and build the haystack filter.

    Returns string

    The haystack filter.

    Throws

    An error if the haystack filter is invalid.

  • Return true if nothing has been written to the builder.

    Returns boolean

    True if the internal buffer is empty.

  • Add a relationship query.

    Parameters

    • name: string | HSymbol

      The name of the relationship to query.

    • Optional term: string | HSymbol

      Optional relationship's term. An empty string can be used to skip this parameter.

    • Optional ref: string | HRef

      Optional target reference value.

    Returns HFilterBuilder

    The builder instance.

Generated using TypeDoc