objects

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 20, 2018 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Has

func Has(_ context.Context, args ...core.Value) (core.Value, error)

Has returns the value stored by the given key. @params (String) - The key name string. @returns (Boolean) - True if the key exists else false.

func Keep

func Keep(_ context.Context, args ...core.Value) (core.Value, error)

Keep returns a new object with only given keys. @params src (Object) - source object. @params keys (Array Of String OR Strings) - keys that need to be keeped. @returns (Object) - New Object with only given keys.

func Keys

func Keys(_ context.Context, args ...core.Value) (core.Value, error)

Keys returns string array of object's keys @params obj (Object) - The object whose keys you want to extract @params sort (Boolean, optional) - If sort is true, then the returned keys will be sorted. @returns (Array of String) - Array that contains object keys.

func Merge

func Merge(_ context.Context, args ...core.Value) (core.Value, error)

Merge merge the given objects into a single object. @params objs (Array Of Object OR Objects) - objects to merge. @returns (Object) - Object created by merging.

func MergeRecursive added in v0.4.0

func MergeRecursive(_ context.Context, args ...core.Value) (core.Value, error)

MergeRecursive recursively merge the given objects into a single object. @params objs (Objects) - objects to merge. @returns (Object) - Object created by merging.

func NewLib

func NewLib() map[string]core.Function

func Values added in v0.4.0

func Values(_ context.Context, args ...core.Value) (core.Value, error)

Values return the attribute values of the object as an array. @params obj (Object) - an object. @returns (Array of Value) - the values of document returned in any order.

func Zip

func Zip(_ context.Context, args ...core.Value) (core.Value, error)

Zip returns an object assembled from the separate parameters keys and values. Keys and values must be arrays and have the same length. @params keys (Array of Strings) - an array of strings, to be used as key names in the result. @params values (Array of Objects) - an array of core.Value, to be used as key values. @returns (Object) - an object with the keys and values assembled.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL