flatten

package
v1.1.8 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2023 License: MPL-2.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrOrAndMustBeArray = errors.New("the value of $or and $and must be an array")

Functions

func Flatten

func Flatten(input interface{}) (map[string]interface{}, error)

Flatten flattens extended JSON which is used to build and store queries.

Payloads that look like this

{
	"person": {
		"age": {
			"$gte": 5
		}
	}
}

would become

{
	"person.age": {
	  "$gte": 5
	}
}

func FlattenWithPrefix

func FlattenWithPrefix(prefix string, input interface{}) (map[string]interface{}, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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