Skip to content

Commit

Permalink
language check
Browse files Browse the repository at this point in the history
  • Loading branch information
Louisa Lambrecht committed Jun 5, 2024
1 parent 6face1b commit 39a38c5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions docs/extensions/json.md
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,7 @@ true

> Warning DuckDB's JSON data type uses [0-based indexing](#indexing).
To modify an existing JSON array there are the following functions.
The table below shows the available functions to modify an exising JSON array.

| function name | Description |
|:----------------------|:--------------------------------------------------|
Expand Down Expand Up @@ -842,7 +842,7 @@ FROM (VALUES ('[54,64,10]'::JSON)) AS _(arr);
+----------------+----------------+----------------+---------+------------+------+---------+
```

It should be noted that negative indeces index from the back or switch the rotation direction.
It should be noted that negative indices index from the back or switch the rotation direction.

```sql
SELECT json_array_insert(arr, '"a"', -2) AS "insert",
Expand All @@ -860,7 +860,7 @@ FROM (VALUES ('[54,64,10]'::JSON)) AS _(arr);
```

`json_array_remove` also takes a positive start and end index to delete a whole range of
values from an JSON array:
values from a JSON array:

```sql
SELECT json_array_remove(arr, 2) AS "remove single element",
Expand All @@ -876,15 +876,15 @@ FROM (VALUES ('[54,64,10]'::JSON)) AS _(arr);
+-----------------------+--------------------------+
```

To manipulate the JSON objects the following functions might be helpful.
To manipulate JSON objects, the following functions are available.

| function name | Description |
|:----------------------|:--------------------------------------------------|
| `json_obj_add` | Adds a value by a given key to JSON object |
| `json_obj_rename_key` | Renames a key in an JSON object |
| `json_obj_replace` | Replaces a value by a given key |

Whereas the behaviour for the three JSON object functions is like so:
The three JSON object manipulation functions behave as such:

```sql
SELECT json_obj_add(obj, 'new', 42::INT) AS "add",
Expand Down

0 comments on commit 39a38c5

Please sign in to comment.