Expressions and code
Query JSON with JMESPath in Duaer
In Duaer, query JSON with $jmespath(object, "query"). Expressions and the JavaScript Code node can call it; the Python Code node cannot.
What $jmespath reads in Duaer
The first argument is the object to query, usually $json or one item from an earlier node. The second is a JMESPath string. The query runs on this execution’s data and does not change the original item.
When a dot path is enough, write $json.body.city. Use JMESPath when you need to filter an array or project fields.
{{ $jmespath($json, "body.city") }}Where you can call it
- A Duaer expression can call $jmespath().
- A JavaScript Code node can call it too.
- The Python Code node has no $jmespath. Read fields with Python dictionaries and lists.
Questions
How many arguments does $jmespath take in Duaer?
In Duaer, two: the JSON to query (usually $json) and a JMESPath string. The query does not change the original item.
Can a Duaer Python Code node call $jmespath?
No. Duaer expressions and the JavaScript Code node can. In Python, read fields with dictionaries and lists.
In this section
Transform data with expressions in Duaer
Use expression transformation functions anywhere expressions are supported in Duaer. When you only reshape fields, prepare them in Edit Fields (Set) first.
TransformObject transformation methods in Duaer
In a Duaer expression, object methods test fields, drop fields, merge objects, and encode an object as a query string.
ExpressionsUse built-in methods and variables in Duaer
Duaer's built-in methods and variables for working with data in expressions. The Code node runs plain JavaScript and native Luxon.