Skip to content

Commit

Permalink
array::clump: remove reference to Rust method, have example show when… (
Browse files Browse the repository at this point in the history
#439)

Co-authored-by: Micha de Vries <[email protected]>
  • Loading branch information
Dhghomon and kearfy authored Mar 25, 2024
1 parent 2fc02e5 commit 6754c14
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -410,17 +410,17 @@ RETURN array::concat([1,2,3,4], [3,4,5,6]);

## `array::clump`

The `array::clump` function returns the original array split into sub-arrays of `size`. Similar to `slice::chunks`
The `array::clump` function returns the original array split into sub-arrays of `size`.

```surql title="API DEFINITION"
array::clump(array, value) -> array
```
The following example shows this function, and its output, when used in a [`RETURN`](/docs/surrealdb/surrealql/statements/return) statement:

```surql
RETURN array::clump([0, 1, 2, 3], 2);
RETURN array::clump([1, 2, 3, 4, 5], 2);
[ [0, 1], [2, 3] ]
[ [1, 2], [3, 4], [5] ]
```

<br />
Expand Down

0 comments on commit 6754c14

Please sign in to comment.