Back to Documentation
Concept

Tag queries

How to write DSL-style queries in tag nodes (Query, Count by Query, Clear/Disable/Enable/Lock by Query).

Tag nodes that take a query input (Query, Count by Query, Clear by Query, Disable/Enable by Query, Lock/Unlock by Query) all use the same rule: the query is a single tag string. The runtime finds all entities that have that exact tag and then performs the node’s action (e.g. count them, clear tags from them, add a disabled tag).

Query format (tag DSL)

A query is a valid tag in the tag DSL format. Tags are colon-separated segments:

category:value
category:value:subvalue
category:part1:part2:part3

Rules:

  • At least two segments — e.g. reel:1, not reel.
  • Each segment — must start with a letter or digit; then only letters, digits, and underscores. Case is normalized to lowercase when stored.
  • No spaces — use colons to separate parts (e.g. symbol:scatter, state:disabled).

Examples of valid queries

QueryMeaning
symbol:scatterAll entities tagged as scatter symbol
reel:1All entities on reel 1 (e.g. positions)
state:lockedAll locked positions
base:wildAll entities with base wild symbol
position:1_2Entity at position 1,2 (if you use that tag)

How each node uses the query

  • Query (tag_query) — Returns the list of entity IDs that have the query tag. Use when you need to operate on “all entities with tag X”.
  • Count by Query (tags.countByQuery) — Same lookup, then writes the count to another tag (e.g. round:scatterCount). Use with Branch: Tag Compare to branch on “scatterCount ≥ 3”.
  • Clear by Query (tags.clearByQuery) — Finds all entities with the query tag, then removes one or more tags from each (e.g. clear win:value from all positions on reel:1).
  • Disable / Enable by Query — Add or remove a “disabled” tag on every entity matching the query (e.g. reel:1, reel:5).
  • Lock / Unlock by Query — Add or remove a lock tag on every entity matching the query (e.g. lock all symbol:wild).

Tips

  • Query is exact tag match only. There is no wildcard (e.g. win*) in the query itself; you target one tag like reel:1.
  • Use consistent naming so the same tag is set by one part of the graph (e.g. slot init sets reel:1, reel:2) and queried by another (e.g. Disable by Query with reel:1).
  • For “all positions”, you’d need a tag that every position has (e.g. a category like entity:position if you set it everywhere), or use multiple nodes (e.g. one per reel:1, reel:2, …).