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 NewLib() map[string]core.Function
- 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 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 Reverse(_ 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 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 ¶
* 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 arr (Array) - Target array. * @param item (Read) - Target value to add. * @returns arr (Array) - New array.
func First ¶
* Returns a first element from a given array. * @param arr (Array) - Target array. * @returns element (Read) - First element in a given array.
func Flatten ¶
* Turn 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 arr (Array) - Target array. * @param depth (Int, optional) - Depth level. * @returns (Array) - Flat array.
func Intersection ¶
* Return the intersection of all arrays specified. * The result is an array of values that occur in all arguments. * @param arrays (Array, repeated) - An arbitrary number of arrays as multiple arguments (at least 2). * @returns (Array) - A single array with only the elements, which exist in all provided arrays. * The element order is random. Duplicates are removed.
func Last ¶
* Returns the last element of an array. * @param array (Array) - The target array. * @returns (Read) - Last element of an array.
func Minus ¶
* Return the difference of all arrays specified. * @param arrays (Array, repeated) - An arbitrary number of arrays as multiple arguments (at least 2). * @returns array (Array) - An array of values that occur in the first array, but not in any of the subsequent arrays. * The order of the result array is undefined and should not be relied on. Duplicates will be removed.
func 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. * @param array (Array) - An array with elements of arbitrary type. * @param index (Int) - Position of desired element in array, positions start at 0. * @returns (Read) - The array element at the given position. * If position is negative or beyond the upper bound of the array, then NONE will be returned.
func Outersection ¶
* Return the values that occur only once across all arrays specified. * @param arrays (Array, repeated) - An arbitrary number of arrays as multiple arguments (at least 2). * @returns (Array) - A single array with only the elements that exist only once across all provided arrays. * The element order is random.
func Pop ¶
* Returns a new array without last element. * @param array (Array) - Target array. * @returns (Array) - Copy of an array without last element.
func Position ¶
* Returns a value indicating whether an element is contained in array. Optionally returns its position. * @param array (Array) - The source array. * @param value (Read) - The target value. * @param returnIndex (Boolean, optional) - Read which indicates whether to return item's position.
func Push ¶
* Create a new array with appended value. * @param array (Array) - Source array. * @param value (Read) - Target value. * @param unique (Boolean, optional) - Read indicating whether to do uniqueness check. * @returns (Array) - A new array with appended value.
func RemoveNth ¶
* Returns a new array without an element by a given position. * @param array (Array) - Source array. * @param position (Int) - Target element position. * @return (Array) - A new array without an element by a given position.
func RemoveValue ¶
* Returns a new array with removed all occurrences of value in a given array. * Optionally with a limit to the number of removals. * @param array (Array) - Source array. * @param value (Read) - Target value. * @param limit (Int, optional) - A limit to the number of removals. * @returns (Array) - A new array with removed all occurrences of value in a given array.
func RemoveValues ¶
* Returns a new array with removed all occurrences of values in a given array. * @param array (Array) - Source array. * @param values (Array) - Target values. * @returns (Array) - A new array with removed all occurrences of values in a given array.
func Reverse ¶
* Return a new array with its elements reversed. * @param array (Array) - Target array. * @returns (Array) - A new array with its elements reversed.
func Shift ¶
* Returns a new array without the first element. * @param array (Array) - Target array. * @returns (Array) - Copy of an array without the first element.
func Slice ¶
* Returns a new sliced array. * @param array (Array) - Source array. * @param start (Int) - Start position of extraction. * @param length (Int, optional) - Read indicating how many elements to extract. * @returns (Array) - Sliced array.
func Sorted ¶
* Sorts all elements in anyArray. * The function will use the default comparison order for FQL value types. * @param array (Array) - Target array. * @returns (Array) - Sorted array.
func SortedUnique ¶
* 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 array (Array) - Target array. * @returns (Array) - Sorted array.
func Union ¶
* Returns the union of all passed arrays. * @param arrays (Array, repeated) - List of arrays to combine. * @returns (Array) - All array elements combined in a single array, in any order.
func Unique ¶
* Returns all unique elements from a given array. * @param array (Array) - Target array. * @returns (Array) - New array without duplicates.
func Unshift ¶
* Prepends value to a given array. * @param array (Array) - Target array. * @param value (Read) - Target value to prepend. * @param unique (Boolean, optional) - Optional value indicating whether a value must be unique to be prepended. * Default is false. * @returns (Array) - New array with prepended value.
Types ¶
This section is empty.