Interface: ExtendedCompoundFilterDef

Oracle® JavaScript Extension Toolkit (JET)
13.0.1

F52697-01

Since:
  • 13.0.0
Module:
  • ojdataprovider

QuickNav

Fields

Description

Defines a kind of DataFilter.FilterDef which applies to the compound filter definitions. It supports a combination of multiple filter definitions with "$and" or "$or" operator.

ExtendedCompoundFilterDef extends CompoundFilterDef, with additional support for NestedFilterDef and TextFilterDef in its criteria. While CompoundFilterDef is supported for backward compatibility reasons, ExtendedCompoundFilterDef should be used in place of CompoundFilterDef going forward.


Usage

Signature:

interface ExtendedCompoundFilterDef<D> extends Omit<CompoundFilterDef<D>, 'criteria'>

Generic Parameters
ParameterDescription
DType of Data for the filter definition. See below for examples.
Typescript Import Format
//To use this interface, import as below.
import {ExtendedCompoundFilterDef} from "ojs/ojdataprovider";

For additional information visit:


Examples

The following extended compound filter definition combines two filter definitions in its criteria with "$or" operator:

  • Attribute filter definition on 'ProductName' field containing the phrase 'Tablet' case insensitive
  • Attribute filter definition on 'ProductId' field starting with the phrase 'TAB'

{op: '$or', criteria:
  {op: '$co', value: {ProductName: 'Tablet'}, collationOptions: {sensitivity: 'accent'}},
  {op: '$sw', value: {ProductId: 'TAB'}}
}

The following extended compound filter definition combines three filter definitions in its criteria with "$and" operator:

  • Attribute filter definition on 'ProductName' field ending with the phrase 'Phone'
  • Text filter definition with string 'Apple'
  • Nested filter definition on 'locationDetails' field with nested criterion:
    • Attribute filter definition on 'Country' subfield being equal 'USA'

{op: '$and', criteria:
  {op: '$ew', value: {ProductName: 'Phone'}},
  {text: 'Apple'},
  {op: '$exists', attribute: 'locationDetails', criterion:
    {op: 'eq', value: {Country: 'USA'}}
  }
}

Fields

criteria :Array.<(AttributeFilterDef.<D>|AttributeExprFilterDef.<D>|ExtendedCompoundFilterDef.<D>|NestedFilterDef.<D>|TextFilterDef)>

Array of FilterDefs that can be combined together using the operator. Each FilterDef in the array can be one of the following types:
  • AttributeFilterDef
  • AttributeExprFilterDef
  • ExtendedCompoundFilterDef
  • NestedFilterDef
  • TextFilterDef
Since:
  • 13.0.0

op :CompoundFilterDef.CompoundOperator

Operator to apply for the filter. Valid operators defined in the CompoundFilterOperator union type are the strings:
  • $and The filters in the criteria array will be AND'd.
  • $or The filters in the criteria array will be OR'd.
Since:
  • 7.0.0
Inherited From: