CreateCompoundFilter
cartographer / createCompoundFilter
Function: createCompoundFilter()
Section titled “Function: createCompoundFilter()”createCompoundFilter(
_settings,filters): (item) =>boolean
Defined in: queries/queryFunctions.ts:111
Build a filter predicate from an array of filter specifications.
Returns a predicate function that checks all filter conditions using AND logic. Supports equals, contains (array/string), range (numeric), and text (case-insensitive substring) matching.
Parameters
Section titled “Parameters”_settings
Section titled “_settings”Datacore settings (for future schema context)
filters
Section titled “filters”object[]
Array of filter specifications with field, type, and value
Returns
Section titled “Returns”- Predicate function that returns true if all filters match
(
item):boolean
Parameters
Section titled “Parameters”Returns
Section titled “Returns”boolean
Example
Section titled “Example”const predicate = createCompoundFilter(settings, [ { field: 'catalog-status', type: 'equals', value: 'approved' }, { field: 'word-count', type: 'range', value: [5000, 50000] }, { field: 'title', type: 'text', value: 'Cthulhu' }]);const results = items.filter(predicate);