GlobalFiltersWithWhere provides methods that allow linking filtering parameters in the Search.where method. It also provides the where function for the Global object, which can be used to work with EQL expressions and with filterClosure .

Type parameters

Hierarchy

Methods

and

  • and(...operands: Filter[]): Filter
  • Combining multiple filters with a logical AND.

    Parameters

    • Rest ...operands: Filter[]

    Returns Filter

fts

  • fts(query: string): Filter
  • Full-text search.

    Parameters

    • query: string

    Returns Filter

not

  • not(...operands: Filter[]): Filter
  • Combining multiple filters with the logical negation.

    Parameters

    • Rest ...operands: Filter[]

    Returns Filter

or

  • or(...operands: Filter[]): Filter
  • Combining multiple filters with a logical OR.

    Parameters

    • Rest ...operands: Filter[]

    Returns Filter

where

  • where(fc: FilterClosure<T>): Filter
  • where(eql: EqlQuery, params?: EqlParams): Filter
  • The [[g.where]] method allows filtering collection items.

    Parameters

    • fc: FilterClosure<T>

      Search filters.

      const searchResults = await Application. search()
      .where((f, g) => g.and( 
        g.where(f => f.__id.eq('66358eab- 54cf-4591-86ba-34b83739c13f')) 
      )) 
      .first(); 
      

    Returns Filter

  • The [[g.where]] method allows filtering collection items.

    Parameters

    • eql: EqlQuery

      EQL expression for search.

      const searchResults = await  Application.search()
      .where(`[__id] = '66358eab-54cf-4591-86ba- 34b83739c13f'`) 
      .first(); 
      

      EQL expression with search parameters:

      const searchResults = await Application.search()
      .where(`[__id]  = @p1 or [__name] = @p2`, {p1: '66358eab-54cf-4591-86ba-34b83739c13f', p2:  'app1'}) 
      .first(); 
      
    • Optional params: EqlParams

    Returns Filter