• 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
    • Dropdowns
    • Editor
    • Excel Export
    • File Saver
    • Form
    • Gantt
    • Gauges
    • Indicators
    • Inputs
    • Labels
    • Layout
    • ListBoxupdated
    • ListView
    • Map
    • Notification
    • OrgChart
    • PDF Processing
    • PDFViewer
    • PivotGrid
    • Popup
    • Progress Bars
    • Ripple
    • Schedulerupdated
    • ScrollView
    • Sortable
    • Spreadsheet
    • 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?