• What is KendoReact
  • Getting Started
  • Server Components
  • Components
    • Animation
    • Barcodes
    • Buttons
    • Chartsupdated
    • Common Utilities
    • Conversational UIupdated
    • Data Gridupdated
    • Data Query
    • Data Tools
    • Date Inputs
    • Date Math
    • Dialogs
    • Drawing
    • Dropdownsupdated
    • Editor
    • Excel Export
    • File Saver
    • Formupdated
    • Ganttupdated
    • Gauges
    • Indicators
    • Inputsupdated
    • Labels
    • Layoutupdated
    • ListBox
    • ListView
    • Map
    • Notification
    • OrgChartnew
    • PDF Processing
    • PDFViewer
    • PivotGrid
    • Popup
    • Progress Bars
    • Ripple
    • Scheduler
    • ScrollView
    • Sortable
    • Spreadsheetupdated
    • TaskBoard
    • Tooltips
    • TreeList
    • TreeViewupdated
    • Upload
  • Sample Applications
  • Styling & Themes
  • Common Features
  • Project Setup
  • Knowledge Base
  • Changelog
  • Updates
  • Troubleshooting

filterBy<T>

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" }]

Parameters

data T[]

The data that will be filtered.

descriptor CompositeFilterDescriptor | FilterDescriptor

The filter criteria that will be applied.

Returns

T[] - The filtered data.

In this article

Not finding the help you need?