JSONata Skill
JSONata is a lightweight query and transformation language for JSON. This skill covers the language, path operators, built-in functions, and the JavaScript embedding API.
Source: jsonata-js/jsonata
Docs: docs.jsonata.org | Try: try.jsonata.org
Core
| Topic | Description | Reference |
|---|---|---|
| Overview | What JSONata is, quick start | overview |
| Simple queries | Object/array navigation, $, indices, ranges | simple-queries |
| Path operators | Map ., filter [], sort ^(), reduce {}, * **, % # @ | path-operators |
| Expressions | Strings &, numbers, boolean in expressions | expressions-operators |
| Comparison | =, !=, <, <=, >, >=, in; deep equality | comparison-operators |
| Other operators | & ? : ?: ?? := ~> transform |...| | other-operators |
| Predicates & wildcards | Filter [expr], * and ** | predicates-wildcards |
| Construction | Array [] and object {} constructors, JSON literals | construction |
| Processing model | Types, sequences, flattening, path stages | processing-model |
| Composition | Parentheses, blocks ( ; ) | composition-blocks |
Features
| Topic | Description | Reference |
|---|---|---|
| Programming | Variables $var, conditionals, functions, recursion, partial application, chaining | programming |
| Embedding API | jsonata(str), evaluate(), assign(), registerFunction(), signatures | embedding-api |
| Sorting & grouping | Order-by, reduce grouping, aggregation | sorting-grouping |
| Higher-order | $map, $filter, $single, $reduce, $sift | higher-order-functions |
| Array functions | $count, $append, $sort, $reverse, $shuffle, $distinct, $zip | array-functions |
| Boolean | $boolean, $not, $exists; and, or | boolean-functions |
| Numeric functions | $number, $abs, $floor, $ceil, $round, $power, $sqrt, $random, $formatNumber, etc. | numeric-functions |
| Object & utility | $keys, $lookup, $spread, $merge, $each, $type, $error, $assert | object-functions |
| String functions | $string, $length, $substring, $split, $join, $match, $replace, base64/URL | string-functions |
| Date/Time | $now, $millis, $fromMillis, $toMillis, ISO 8601, picture strings | date-time |
| Built-in overview | Summary and links to full function docs | built-in-functions |
| Regex | /regex/flags, predicates, $match, $contains, etc. | regex |
Advanced
| Topic | Description | Reference |
|---|---|---|
| Function signatures | <params:return>, type symbols, optional/context args | embedding-api, programming |
| Closures, tail recursion | Lexical scope, tail-call optimization | programming |
| Transform operator | Deep copy + targeted update/delete | other-operators |