Useful when preparing stub data for bulk operations, the parse_jsonl
filter accepts a multiline string in which each line contains a complete JSON object. It returns an array of parsed objects.
{% capture jsonl_string %}
{"id":"gid://shopify/Customer/12345","email":"foo@bar.baz"}
{"id":"gid://shopify/Customer/67890","email":"bar@baz.qux"}
{% endcapture %}
{% assign json_objects = jsonl_string | parse_jsonl %}
{{ json_objects | map: "email" | join: ", " }}
foo@bar.baz, bar@baz.qux