query_entities
Retrieve entities from an Arkiv chain using SQL-like filter expressions (comparisons, logical operators, glob, $owner, $creator, $key). Paginate with cursor, limit results, and select included fields.
Instructions
Query entities from an Arkiv database chain using a filter expression. The filter uses a SQL-like syntax: comparisons (=, !=, <, >, <=, >=), logical operators (&& and ||), negation (!), and glob matching (~). Special attributes: $all (match everything), $owner (current owner address), $creator (original creator address, immutable), $key (entity key). Examples: '$all', 'status = "active"', 'score > 100', 'project = "myapp" && status = "active"', '$owner = "0x1234..."', 'name ~ "test*"'
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filter | No | Filter expression. Defaults to "$all" if omitted. Examples: 'status = "active"', 'score > 100 && type = "post"', '$owner = "0xAbc..."', '$creator = "0xDef..."', 'name ~ "prefix*"' | |
| limit | No | Maximum number of entities to return (max 200) | |
| cursor | No | Pagination cursor returned by a previous query | |
| withAttributes | No | Include attributes in results (default: true) | |
| withMetadata | No | Include metadata (owner, creator, expiry) in results (default: true) | |
| withPayload | No | Include payload in results as base64 (default: true) | |
| validAtBlock | No | Query state at a specific block number |