From 659382098145a9a5d5a080717197df8bb56af544 Mon Sep 17 00:00:00 2001 From: Will Russell Date: Thu, 5 Dec 2024 11:04:39 +0000 Subject: [PATCH] fix: toIon and fromIon --- content/docs/expressions/index.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/content/docs/expressions/index.md b/content/docs/expressions/index.md index dd1d8200e7..ea19a292d7 100644 --- a/content/docs/expressions/index.md +++ b/content/docs/expressions/index.md @@ -596,6 +596,16 @@ In versions prior to [v0.18.0](/blogs/2024-08-06-release-0-18.md), this filter w --- +### `toIon` + +The `toIon` filter converts any object into an Ion string. Example: + +```twig +{{ myObject | toIon }} +``` + +--- + ### `jq` The `jq` filter applies a [JQ expression](https://stedolan.github.io/jq/) to a variable. The result is always an array formatted as JSON. Use the `first` filter to extract the first (or only) result. @@ -1461,6 +1471,18 @@ Examples: --- +### fromIon + +The `fromIon` function parses a ION string into an object, enabling property access. + +Example: + +```twig +{{ fromIon(read(someItem)).someField }} +``` + +--- + ### yaml The `yaml` function parses a YAML string into an object.