objects

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2023 License: Apache-2.0 Imports: 6 Imported by: 4

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. @param {String} key - The key name string. @return {Boolean} - True if the key exists else false.

func KeepKeys added in v0.7.0

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

KEEP_KEYS returns a new object with only given keys. @param {Object} obj - Source object. @param {String, repeated} keys - Keys that need to be kept. @return {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 @param {Object} obj - The object whose keys you want to extract @param {Boolean} [sort=False] - If sort is true, then the returned keys will be sorted. @return {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. @param {Object, repeated} objects - Objects to merge. @return {Object} - Object created by merging.

func MergeRecursive added in v0.4.0

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

MERGE_RECURSIVE recursively merge the given objects into a single object. @param {Objects, repeated} objects - Objects to merge. @return {Object} - Object created by merging.

func RegisterLib added in v0.8.0

func RegisterLib(ns core.Namespace) error

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. @param {Object} object - Target object. @return {Any[]} - 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. @param {String[]} keys - An array of strings, to be used as key names in the result. @param {Object[]} values - An array of core.Value, to be used as key values. @return {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