Expressions and code
Object transformation methods in Duaer
In a Duaer expression, object methods test fields, drop fields, merge objects, and encode an object as a query string.
Methods
- keys() returns the field names. values() returns the values.
- hasField(name) says whether that field exists (top-level only, case-sensitive).
- isEmpty() and isNotEmpty() treat an object with no fields as empty.
- compact() drops fields whose values are empty.
- removeField(name) removes one field.
- keepFieldsContaining(text) and removeFieldsContaining(text) keep or drop fields whose names contain that text.
- merge(other) merges another object. The other object wins on a shared field name.
- toJsonString() returns a JSON string.
- urlEncode() encodes the object as a URL query string.
{{ $json.address.hasField("city") }}Questions
What does hasField test in Duaer?
In a Duaer expression, whether that field exists (top-level only, case-sensitive). keys() returns field names; values() returns the values.
Which value wins on merge in Duaer when both objects share a field?
In a Duaer expression, merge(other) combines the objects. On a shared field name, the other object’s value wins.
In this section
Use data transformation methods in Duaer
In a Duaer expression, call a transformation method on a value, such as {{ $json.name.toTitleCase() }}. Methods are grouped by array, boolean, date, number, object, and string.
TransformArray transformation methods in Duaer
In a Duaer expression, call an array method on the array, such as {{ $json.ids.unique() }}. average, max, and min throw if any element is not a number.
QueryQuery 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.