Validates filter and compiles it into a predicate.
filter
The filter object (QueryOptions.filter), or nothing.
QueryOptions.filter
none when there is nothing to apply, ok with the predicate, or unsupported with the reason — an unknown operator, a non-array $and / $in, a nested object used as a value, and so on.
none
ok
unsupported
$and
$in
const compiled = CompileMetadataFilter({ Entity: { $in: ['Members'] }, Status: 'Active' });if (compiled.Status === 'ok') { const keep = compiled.Predicate(field => row[field]);} Copy
const compiled = CompileMetadataFilter({ Entity: { $in: ['Members'] }, Status: 'Active' });if (compiled.Status === 'ok') { const keep = compiled.Predicate(field => row[field]);}
Validates
filterand compiles it into a predicate.