Skip to main content
The Filter command (Command Type: 1004) selectively includes or excludes objects from a collection based on specific field values. It supports both allowlist and blocklist filtering modes.

Overview

The Filter command provides functionality for:
  • Including only objects whose field value matches the filter list
  • Excluding objects whose field value matches the filter list
  • Filtering by string, number, or boolean values

Command Type

Command Type ID: 1004

Parameters

ParameterTypeDescriptionRequired
filterArray of string / number / booleanDefines the set of values to be matched against the keyYes
includebooleanIf true, returns only items matching the filter. If false, excludes matching itemsYes
keystringSpecifies the field in each object used for filteringYes

Usage Examples

Include Only Specific Statuses

{
  "command": "filter",
  "params": {
    "key": "status",
    "filter": ["active", "pending"],
    "include": true
  }
}

Exclude Specific IDs

{
  "command": "filter",
  "params": {
    "key": "id",
    "filter": [101, 202, 303],
    "include": false
  }
}

Filter by Boolean Flag

{
  "command": "filter",
  "params": {
    "key": "isVisible",
    "filter": [true],
    "include": true
  }
}

Common Use Cases

  • Status Filtering: Keep only records in specific states (e.g. active, live)
  • ID Exclusion: Remove known irrelevant or blacklisted IDs
  • Feature Flagging: Filter based on boolean feature flags in the data
  • Distinct - Remove duplicates after filtering
  • Json Path - Extract specific fields from filtered results
  • Key Mapping - Remap fields after filtering