Transform expression syntax


#1

What is the proper syntax for writing transform expressions? When do I use single quotes vs. double quotes?


#2

We use single quotes to encompass the whole expression, and double quotes when referencing an attribute within an expression. (Or vice versa: double quotes to encompass the whole expression, and single quotes within an expression)
For example:
location: ~ expression ‘{“latitude”: “departureLat”, “longitude”: “departureLong”}’


#3

@bachr

Can you comment on this?
I have seen two versions:

field: ~ expression {id : "value"}

and

field: ~ expression "{id : value }"

Which one is correct?


#4

I prefer the first option, but not sure if the second one is incorrect.


#5

This is a nice summary: Quotes and escaping in transform expressions