Awee

Collections

Sort, filter, find, and reshape arrays and maps.

Collections

ModifierDescription
filterFilter returns a subset of a slice where a nested field matches a value.
findFind returns the first element in a slice or map where a field equals the given value.
firstFirst returns the first character of a string or the first element of a slice.
flattenFlatten flattens a slice of slices by one level.
hasHas returns true if the slice or map contains the given value.
isIs returns true if the value equals any of the given parameters.
keyKey extracts a value from a map or slice by key path or index.
lastLast returns the last character of a string or the last element of a slice.
mapMap converts a slice of maps into a map keyed by the given field's string value.
mergeMerge converts a slice of maps into a map keyed by the given field's string value.
pluckPluck extracts a single field from each element of a slice of maps and returns a slice of values.
sortSort sorts a slice in ascending or descending order.
sumSum returns the numeric sum of the elements of a slice.
wrapWrap wraps the value in a map under the given key.

How is this guide?

On this page