objects

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2021 License: Apache-2.0 Imports: 6 Imported by: 6 modules, 4 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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