Documentation ¶
Index ¶
- func Append(_ context.Context, args ...core.Value) (core.Value, error)
- func First(_ context.Context, args ...core.Value) (core.Value, error)
- func Flatten(_ context.Context, args ...core.Value) (core.Value, error)
- func Intersection(_ context.Context, args ...core.Value) (core.Value, error)
- func Last(_ context.Context, args ...core.Value) (core.Value, error)
- func Minus(_ context.Context, args ...core.Value) (core.Value, error)
- func Nth(_ context.Context, args ...core.Value) (core.Value, error)
- func Outersection(_ context.Context, args ...core.Value) (core.Value, error)
- func Pop(_ context.Context, args ...core.Value) (core.Value, error)
- func Position(_ context.Context, args ...core.Value) (core.Value, error)
- func Push(_ context.Context, args ...core.Value) (core.Value, error)
- func RegisterLib(ns core.Namespace) error
- func RemoveNth(_ context.Context, args ...core.Value) (core.Value, error)
- func RemoveValue(_ context.Context, args ...core.Value) (core.Value, error)
- func RemoveValues(_ context.Context, args ...core.Value) (core.Value, error)
- func Shift(_ context.Context, args ...core.Value) (core.Value, error)
- func Slice(_ context.Context, args ...core.Value) (core.Value, error)
- func Sorted(_ context.Context, args ...core.Value) (core.Value, error)
- func SortedUnique(_ context.Context, args ...core.Value) (core.Value, error)
- func ToUniqueArray(arr *values.Array) *values.Array
- func Union(_ context.Context, args ...core.Value) (core.Value, error)
- func UnionDistinct(_ context.Context, args ...core.Value) (core.Value, error)
- func Unique(_ context.Context, args ...core.Value) (core.Value, error)
- func Unshift(_ context.Context, args ...core.Value) (core.Value, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Append ¶
APPEND appends a new item to an array and returns a new array with a given element. If “uniqueOnly“ is set to true, then will add the item only if it's unique. @param {Any[]} arr - Target array. @param {Any} item - Target value to add. @return {Any[]} - New array.
func First ¶
FIRST returns a first element from a given array. @param {Any[]} arr - Target array. @return {Any} - First element in a given array.
func Flatten ¶
FLATTEN turns an array of arrays into a flat array. All array elements in array will be expanded in the result array. Non-array elements are added as they are. The function will recurse into sub-arrays up to the specified depth. Duplicates will not be removed. @param {Any[]} arr - Target array. @param {Int} [depth] - Depth level. @return {Any[]} - Flat array.
func Intersection ¶
INTERSECTION return the intersection of all arrays specified. The result is an array of values that occur in all arguments. The element order is random. Duplicates are removed. @param {Any[], repeated} arrays - An arbitrary number of arrays as multiple arguments (at least 2). @return {Any[]} - A single array with only the elements, which exist in all provided arrays.
func Last ¶
LAST returns the last element of an array. @param {Any[]} array - The target array. @return {Any} - Last element of an array.
func Minus ¶
MINUS return the difference of all arrays specified. The order of the result array is undefined and should not be relied on. Duplicates will be removed. @param {Any[], repeated} arrays - An arbitrary number of arrays as multiple arguments (at least 2). @return {Any[]} - An array of values that occur in the first array, but not in any of the subsequent arrays.
func Nth ¶
NTH returns the element of an array at a given position. It is the same as anyArray[position] for positive positions, but does not support negative positions. If position is negative or beyond the upper bound of the array, then NONE will be returned. @param {Any[]} array - An array with elements of arbitrary type. @param {Int} index - Position of desired element in array, positions start at 0. @return {Any} - The array element at the given position.
func Outersection ¶
OUTERSECTION return the values that occur only once across all arrays specified. The element order is random. @param {Any[], repeated} arrays - An arbitrary number of arrays as multiple arguments (at least 2). @return {Any[]} - A single array with only the elements that exist only once across all provided arrays.
func Pop ¶
POP returns a new array without last element. @param {Any[]} array - Target array. @return {Any[]} - Copy of an array without last element.
func Position ¶
POSITION returns a value indicating whether an element is contained in array. Optionally returns its position. @param {Any[]} array - The source array. @param {Any} value - The target value. @param {Boolean} [position=False] - Boolean value which indicates whether to return item's position. @return {Boolean | Int} - A value indicating whether an element is contained in array.
func Push ¶
PUSH create a new array with appended value. @param {Any[]} array - Source array. @param {Any} value - Target value. @param {Boolean} [unique=False] - Read indicating whether to do uniqueness check. @return {Any[]} - A new array with appended value.
func RegisterLib ¶ added in v0.8.0
func RemoveNth ¶
REMOVE_NTH returns a new array without an element by a given position. @param {Any[]} array - Source array. @param {Int} position - Target element position. @return {Any[]} - A new array without an element by a given position.
func RemoveValue ¶
REMOVE_VALUE returns a new array with removed all occurrences of value in a given array. Optionally with a limit to the number of removals. @param {Any[]} array - Source array. @param {Any} value - Target value. @param {Int} [limit] - A limit to the number of removals. @return {Any[]} - A new array with removed all occurrences of value in a given array.
func RemoveValues ¶
REMOVE_VALUES returns a new array with removed all occurrences of values in a given array. @param {Any[]} array - Source array. @param {Any[]} values - Target values. @return {Any[]} - A new array with removed all occurrences of values in a given array.
func Shift ¶
SHIFT returns a new array without the first element. @param {Any[]} array - Target array. @return {Any[]} - Copy of an array without the first element.
func Slice ¶
SLICE returns a new sliced array. @param {Any[]} array - Source array. @param {Int} start - Start position of extraction. @param {Int} [length] - Read indicating how many elements to extract. @return {Any[]} - Sliced array.
func Sorted ¶
SORTED sorts all elements in anyArray. The function will use the default comparison order for FQL value types. @param {Any[]} array - Target array. @return {Any[]} - Sorted array.
func SortedUnique ¶
SORTED_UNIQUE sorts all elements in anyArray. The function will use the default comparison order for FQL value types. Additionally, the values in the result array will be made unique @param {Any[]} array - Target array. @return {Any[]} - Sorted array.
func Union ¶
UNION returns the union of all passed arrays. @param {Any[], repeated} arrays - List of arrays to combine. @return {Any[]} - All array elements combined in a single array, in any order.
func UnionDistinct ¶
UNION_DISTINCT returns the union of all passed arrays with unique values. @param {Any[], repeated} arrays - List of arrays to combine. @return {Any[]} - All unique array elements combined in a single array, in any order.
func Unique ¶
UNIQUE returns all unique elements from a given array. @param {Any[]} array - Target array. @return {Any[]} - New array without duplicates.
func Unshift ¶
UNSHIFT prepends value to a given array. @param {Any[]} array - Target array. @param {Any} value - Target value to prepend. @param {Boolean} [unique=False] - Optional value indicating whether a value must be unique to be prepended. Default is false. @return {Any[]} - New array with prepended value.
Types ¶
This section is empty.