rename

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 26, 2022 License: BSD-3-Clause Imports: 2 Imported by: 2

README

rename function

rename() will update the replace existing key names with new ones based on the provided configuration. It currently only works for top level fields (i.e. address.street would not work).

configuration
rename({"field_map": {"test":"renamed"}})
example

message in

{
    "_id": 0,
    "name": "transporter",
    "type": "function",
    "count": 10
}

config

rename({"field_map": {"count":"total"}})

message out

{
    "_id": 0,
    "name": "transporter",
    "type": "function",
    "total": 10
}

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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