From d5787f7cf5b91c4553a4d10605a172e4c4d76ad5 Mon Sep 17 00:00:00 2001 From: Emma Short Date: Tue, 11 Jun 2024 00:10:41 -0700 Subject: [PATCH] Add ttcQuery --- ttcQuery.md | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 ttcQuery.md diff --git a/ttcQuery.md b/ttcQuery.md new file mode 100644 index 0000000..c7c83c5 --- /dev/null +++ b/ttcQuery.md @@ -0,0 +1,61 @@ +ttcQuery is a custom query language that is standard for use in TTC. The concept is that you should be able to write a query in nearly any text box - search, template, value - and when the page is rendered, it displays that query. Searches will run the query and render the results in a list template. + +**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 +Query current object: `^` + - refers specifically to the object based off of this specific type +Query relative object: `$` + - 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 +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 +Comparators: + `=` is similar to + `==` is exactly the same + `>` greater than + `<` less than + `>=` greater than or equal to + `<=` less than or equal to + `!!` is true/exists + `!` is not + `/` or, allows matching one or more comparators at the same time +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-- +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 +single query: `<