Update ttcQuery
parent
0aec3dbf33
commit
64a58145dc
46
ttcQuery.md
46
ttcQuery.md
@ -3,21 +3,21 @@ ttcQuery is a custom query language that is standard for use in TTC. The concept
|
|||||||
**Syntax**
|
**Syntax**
|
||||||
|
|
||||||
Start query: `?`
|
Start query: `?`
|
||||||
- by default, queries search the current publication
|
- by default, queries search the current publication
|
||||||
- you can specify a publication by following this with the name, by default it will use the latest release of a publication
|
- you can specify a publication by following this with the name, by default it will use the latest release of a publication
|
||||||
- you can specify the version by including it in a pair of square brackets
|
- you can specify the version by including it in a pair of square brackets
|
||||||
Query current object: `^`
|
Query current object: `^`
|
||||||
- refers specifically to the object based off of this specific type
|
- refers specifically to the object based off of this specific type
|
||||||
Query relative object: `$`
|
Query relative object: `$`
|
||||||
- refers to the last relative object in the hierarchy
|
- refers to the last relative object in the hierarchy
|
||||||
Access child: `.`
|
Access child: `.`
|
||||||
- this also maps over all items in a list and returns a list of the relevant children
|
- this also maps over all items in a list and returns a list of the relevant children
|
||||||
- if the parent is a list, it will return a list of just the specified child
|
- if the parent is a list, it will return a list of just the specified child
|
||||||
Select: `[]`
|
Select: `[]`
|
||||||
- Selects any of the items that matches the provided selector
|
- Selects any of the items that matches the provided selector
|
||||||
- Providing a number selects the ordinal item in the list
|
- Providing a number selects the ordinal item in the list
|
||||||
- Providing a comparator selects items that match the comparator
|
- Providing a comparator selects items that match the comparator
|
||||||
- Selectors can be separated by either commas for "and" or slashes for "or", but not both
|
- Selectors can be separated by either commas for "and" or slashes for "or", but not both
|
||||||
|
|
||||||
Comparators:
|
Comparators:
|
||||||
- `=` is similar to
|
- `=` is similar to
|
||||||
@ -26,7 +26,7 @@ Comparators:
|
|||||||
- `<` less than
|
- `<` less than
|
||||||
- `>=` greater than or equal to
|
- `>=` greater than or equal to
|
||||||
- `<=` less than or equal to
|
- `<=` less than or equal to
|
||||||
- `!!` is true/exists
|
- `!!` is true/exists. When used as the name of a child, it treats the entire parent as a list and returns the key as $0 and the value as $1 for each child.
|
||||||
- `!` is not
|
- `!` is not
|
||||||
- `/` or, allows matching one or more comparators at the same time
|
- `/` or, allows matching one or more comparators at the same time
|
||||||
|
|
||||||
@ -34,7 +34,7 @@ Combiner: `()`
|
|||||||
- Will only select items that match all of the selectors
|
- Will only select items that match all of the selectors
|
||||||
- Selectors can be separated by either commas for "and" or slashes for "or", but not both
|
- Selectors can be separated by either commas for "and" or slashes for "or", but not both
|
||||||
|
|
||||||
--Templating--
|
Inline Templating
|
||||||
insertion: `{{}}`
|
insertion: `{{}}`
|
||||||
- Allows for queries to be wrapped in a templated string
|
- Allows for queries to be wrapped in a templated string
|
||||||
- Can be either a direct query or used in combination with the "_" character to reference a single query
|
- Can be either a direct query or used in combination with the "_" character to reference a single query
|
||||||
@ -51,13 +51,13 @@ separator: `::;;`
|
|||||||
- should support any standard escaped characters such as newline
|
- should support any standard escaped characters such as newline
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
`?core.weapon_abilities[name=Rapid Fire].body`
|
`?core.weapon_abilities[name=Rapid Fire].body`
|
||||||
- this searches the publication 'core' object for weapon_abilities that have the name
|
- this searches the publication 'core' object for weapon_abilities that have the name
|
||||||
`?core[v1].weapon_abilities[name=Rapid Fire].body`
|
`?core[v1].weapon_abilities[name=Rapid Fire].body`
|
||||||
- this searches version 'v1' of the publication 'core' object for weapon_abilities that have the name
|
- this searches version 'v1' of the publication 'core' object for weapon_abilities that have the name
|
||||||
`Sustained Hits {{?^sustained_hits}}`
|
`Sustained Hits {{?^sustained_hits}}`
|
||||||
- This formats the string with the queried values, which start the query within the same object that the field exists in. This would result in the string 'Sustained Hits 1'
|
- This formats the string with the queried values, which start the query within the same object that the field exists in. This would result in the string 'Sustained Hits 1'
|
||||||
`Anti-{{_.keyword}} {{_.value}}<<?^anti_abilities`
|
`Anti-{{_.keyword}} {{_.value}}<<?^anti_abilities`
|
||||||
- This formats the string with the queried values, which start the query within the same object that the field exists in. This would result in the string 'Anti-Infantry 2+' or 'Anti-Infantry 2+, Anti-Monster 4+' if there are more than one matching values
|
- This formats the string with the queried values, which start the query within the same object that the field exists in. This would result in the string 'Anti-Infantry 2+' or 'Anti-Infantry 2+, Anti-Monster 4+' if there are more than one matching values
|
||||||
`Anti-{{_.keyword}} {{_.value}}:://;;<<?^anti_abilities`
|
`Anti-{{_.keyword}} {{_.value}}:://;;<<?^anti_abilities`
|
||||||
- This formats the string with the queried values, which start the query within the same object that the field exists in. This would result in the string 'Anti-Infantry 2+' or 'Anti-Infantry 2+//Anti-Monster 4+' if there are more than one matching values
|
- This formats the string with the queried values, which start the query within the same object that the field exists in. This would result in the string 'Anti-Infantry 2+' or 'Anti-Infantry 2+//Anti-Monster 4+' if there are more than one matching values
|
Loading…
x
Reference in New Issue
Block a user