All Components

filterBy

Filters the provided array according to the specified
CompositeFilterDescriptor.

import { filterBy } from '@progress/kendo-data-query';

const data = [
 { name: "Pork", category: "Food", subcategory: "Meat" },
 { name: "Pepper", category: "Food", subcategory: "Vegetables" },
 { name: "Beef", category: "Food", subcategory: "Meat" }
];

const result = filterBy(data, {
    logic: 'and',
    filters: [
          { field: "name", operator: "startswith", value: "p", ignoreCase: true },
          { field: "subcategory", operator: "eq", value: "Meat" },
    ]
});

// output:
//[{ "name": "Pork", "category": "Food", "subcategory": "Meat" }]
In this article