From 64a58145dc3bb32f5fef24a6d66d05f07ad48a78 Mon Sep 17 00:00:00 2001 From: Emma Short Date: Tue, 11 Jun 2024 00:57:51 -0700 Subject: [PATCH] Update ttcQuery --- ttcQuery.md | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/ttcQuery.md b/ttcQuery.md index e7dee3a..4769698 100644 --- a/ttcQuery.md +++ b/ttcQuery.md @@ -3,21 +3,21 @@ ttcQuery is a custom query language that is standard for use in TTC. The concept **Syntax** Start query: `?` - - 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 the version by including it in a pair of square brackets +- 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 the version by including it in a pair of square brackets 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: `$` - - refers to the last relative object in the hierarchy +- refers to the last relative object in the hierarchy Access child: `.` - - 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 +- 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 Select: `[]` - - Selects any of the items that matches the provided selector - - Providing a number selects the ordinal item in the list - - 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 +- Selects any of the items that matches the provided selector +- Providing a number selects the ordinal item in the list +- 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 Comparators: - `=` is similar to @@ -26,7 +26,7 @@ Comparators: - `<` less than - `>=` greater 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 - `/` 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 - Selectors can be separated by either commas for "and" or slashes for "or", but not both ---Templating-- +Inline Templating insertion: `{{}}` - 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 @@ -51,13 +51,13 @@ separator: `::;;` - should support any standard escaped characters such as newline Examples: - `?core.weapon_abilities[name=Rapid Fire].body` - - this searches the publication 'core' object for weapon_abilities that have the name - `?core[v1].weapon_abilities[name=Rapid Fire].body` - - this searches version 'v1' of the publication 'core' object for weapon_abilities that have the name - `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' - `Anti-{{_.keyword}} {{_.value}}<