Skip to content

Commit

Permalink
[4.9][filterx] [] and {} are now aliases for json_array() and json()
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Fekete authored and Robert Fekete committed Nov 11, 2024
1 parent 3d6c16a commit 19285f6
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions content/filterx/function-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,13 @@ Usage: `json(<string or expression to cast to json>)`
For example:

```shell
js = json({"key": "value"});
js_dict = json({"key": "value"});
```

Starting with version 4.9, you can use `{}` without the `json()` keyword as well. For example, the following creates an empty JSON object:

```shell
js_dict = {};
```

## json_array {#json-array}
Expand All @@ -205,7 +211,13 @@ Usage: `json_array(<string or expression to cast to json array>)`
For example:

```shell
list = json_array(["first_element", "second_element", "third_element"]);
js_list = json_array(["first_element", "second_element", "third_element"]);
```

Starting with version 4.9, you can use `[]` without the `json_array()` keyword as well. For example, the following creates an empty JSON list:

```shell
js_dict = [];
```

## len
Expand Down

0 comments on commit 19285f6

Please sign in to comment.