Type parameters

Hierarchy

  • ReportSearch

Methods

all

  • all(): Promise<Partial<TData>[]>
  • The method loads report app items.

    By default, the number of search results is 10. If you need more items, use the ReportSearch.size method.

    const reportItems = await  Context.fields.report.search().all();
    

    Returns Promise<Partial<TData>[]>

from

  • from(value: number): this
  • The method allows you to skip a specified number of search results.

    Parameters

    • value: number

      Number of app items to skip. For example, when you work with a large amount of items, you can split results into chunks and define which item needs to be displayed as the first search result in a dynamic way.

      for (var i = 0; i < 10; i++) {
          const from = 100 * i; 
          const  reportItems = await Context.fields.report.search() 
              .from(from)  
              .all(); 
      } 
      

    Returns this

having

  • having(fc: FilterClosure<THaving>): this
  • The method can be used to filter a report’s columns with aggregation.

    Parameters

    • fc: FilterClosure<THaving>

      Search filters. Search by one field:

      const reportItems =  await Context.fields.report.search()
          .having(f => f.document_count. gte(50)) 
          .all(); 
      

      Search by several fields:

      const  reportItems = await Context.fields.report.search()
          .having((f, g) =>  g.and ( 
              f.document_count.gte(50), 
              f.document_count.lte(100) , 
          )) 
          .all(); 
      

    Returns this

size

  • size(value: number): this
  • The method is used to limit the number of returned search results.

    Parameters

    • value: number

      Number of search results displayed (the default value is 10, the maximum is 10000).

      const reportItems = await Context.fields.report. search()
          .size(500) 
          .all(); 
      

    Returns this

sort

  • sort(column: string, ascending?: undefined | false | true): this
  • The method is used to sort search results.

    Parameters

    • column: string

      Code of the column that sorting is based on.

    • Optional ascending: undefined | false | true

      If the parameter is set to true, items are sorted in the ascending order, it the value is false, in the descending order.

      const  reportItems = await Context.fields.report.search()
          .sort('name', true)  
          .all(); 
      

    Returns this

where

  • where(fc: FilterClosure<TWhere>): this
  • The method can be used to filter a report’s columns without aggregation.

    Parameters

    • fc: FilterClosure<TWhere>

      Search filters. Search by one field:

      const reportItems =  await Context.fields.report.search()
          .where(f => f.price.gte(10000))  
          .all(); 
      

      Search by several fields:

      const  reportItems = await Context.fields.report.search()
          .where((f, g) =>  g.and ( 
              f.price.gte(10000), 
              f.price.lte(20000), 
          ))  
          .all(); 
      

    Returns this