Collections
Work with arrays and maps — sort, filter, find, extract keys, and reshape data.
Collections
| Modifier | Description |
|---|---|
filter | Filter returns a subset of a slice where a nested field matches a value. |
find | Find returns the first element in a slice or map where a field equals the given value. |
first | First returns the first character of a string or the first element of a slice. |
has | Has returns true if the slice or map contains the given value. |
is | Is returns true if the value equals any of the given parameters. |
key | Key extracts a value from a map or slice by key path or index. |
last | Last returns the last character of a string or the last element of a slice. |
map | Map converts a slice of maps into a map keyed by the given field's string value. |
merge | Merge converts a slice of maps into a map keyed by the given field's string value. |
sort | Sort sorts a slice in ascending or descending order. |
wrap | Wrap wraps the value in a map under the given key. |
How is this guide?