@mantlebee/ts-data
    Preparing search index...

    Function filterItems

    • Keeps the items of a list matching an expression, as a server would: every FilterOperators member, FiltersExpression trees at any depth; an empty list or group matches every item; a null value matches an unset field with equal / in, never with the ordered operators (gt, range, ...) nor with the string ones; whether an unset field matches the negated operators (notEqual, notIn, notContains) depends on options.nullSemantics. See itemMatchesFilter for the operators. The list and its items are never mutated; the result is always a new array.

      Type Parameters

      • TItem = any

      Parameters

      Returns List<TItem>

      the matching items, in their order; a copy of the list without an expression.

      const adults = filterItems(users, {
      filters: [{ field: "age", operator: FilterOperators.greaterThanOrEqual, value: 18 }],
      logic: FilterLogics.and,
      });