Type of the items.
Optionalcasetrue to compare strings as they are. By default (false) strings are
lower-cased before any comparison, so equal, contains, startsWith,
endsWith, in and the sorts ignore the case. equalInsensitive
ignores the case whatever this option.
OptionalnullHow the filters match an unset field, see InMemoryNullSemantics.
"javascript" by default; "sql" makes an in-memory fake agree with a
SQL backend, where status <> 'archived' drops the rows whose status
is NULL.
const items = [{ status: "active" }, { status: null }];
const notArchived: FiltersExpression<Item> = {
filters: [{ field: "status", operator: FilterOperators.notEqual, value: "archived" }],
logic: FilterLogics.and,
};
filterItems(items, notArchived); // both items
filterItems(items, notArchived, { nullSemantics: "sql" }); // [{ status: "active" }]
OptionaltoReplaces the default conversion (toComparableValue) of a value
into the primitive actually compared. It receives both sides of every
comparison, the value of the item and the value of the filter, with the
field they belong to, so the rule can differ per field. Its result is
used as it is: lower-case the strings yourself when needed. Return
null for an unset value.
Options of the in-memory delegates (filterItems, sortItems) and of queryItems / countItems: how the values of the items and of the filters are compared.