Skip to main content

Comparison Operators

OperatorDescriptionExample
eqEquals{"status": {"eq": "active"}}
neqNot equals{"status": {"neq": "deleted"}}
gtGreater than{"updatedAt": {"gt": "2024-01-01"}}
gteGreater than or equal{"updatedAt": {"gte": "2024-01-01"}}
ltLess than{"updatedAt": {"lt": "2024-12-31"}}
lteLess than or equal{"updatedAt": {"lte": "2024-12-31"}}

Example: Date Range

{
  "filter": {
    "updatedAt": {
      "gte": "2024-01-01T00:00:00Z",
      "lte": "2024-12-31T23:59:59Z"
    }
  }
}

Array Operators

OperatorDescriptionExample
inValue in array{"type": {"in": ["image/jpeg", "image/png"]}}
allContains all values{"tags": {"all": ["hero", "product"]}}
anyContains any value{"tags": {"any": ["hero", "banner"]}}

Example: Multiple Types

{
  "filter": {
    "type": {
      "in": ["image/jpeg", "image/png", "image/webp"]
    }
  }
}

Example: Tag Matching

{
  "filter": {
    "tags": {
      "all": ["hero", "homepage"]
    }
  }
}

Pattern Operators

OperatorDescriptionExample
likePattern matching (% wildcard){"name": {"like": "hero%"}}

Example: Name Pattern

{
  "filter": {
    "name": {
      "like": "banner-%"
    }
  }
}

Combining Operators

Multiple operators can be combined within a single filter:
{
  "filter": {
    "type": {
      "in": ["image/jpeg", "image/png"]
    },
    "tags": {
      "any": ["hero", "product"]
    },
    "status": {
      "eq": "active"
    },
    "updatedAt": {
      "gte": "2024-01-01T00:00:00Z"
    }
  }
}
All filter conditions are combined with AND logic. An asset must match all conditions to be included in results.