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:part3Rules:
- At least two segments — e.g.
reel:1, notreel. - 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
| Query | Meaning |
|---|---|
symbol:scatter | All entities tagged as scatter symbol |
reel:1 | All entities on reel 1 (e.g. positions) |
state:locked | All locked positions |
base:wild | All entities with base wild symbol |
position:1_2 | Entity 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:valuefrom all positions onreel: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 likereel: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 withreel:1). - For “all positions”, you’d need a tag that every position has (e.g. a category like
entity:positionif you set it everywhere), or use multiple nodes (e.g. one perreel:1,reel:2, …).