1.1 KiB
1.1 KiB
title | description | aliases | menu | weight | flux/v0.x/tags | introduced | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
json.encode() function | The `json.encode()` function converts a value into JSON bytes. |
|
|
202 |
|
0.40.0 |
The json.encode()
function converts a value into JSON bytes.
import "json"
json.encode(v: "some value")
// Returns [34 115 111 109 101 32 118 97 108 117 101 34]
This function encodes Flux types as follows:
time
values in RFC3339 formatduration
values in number of milliseconds since the epochregexp
values as their string representationbytes
values as base64-encoded stringsfunction
values are not encoded and produce an error
Parameters
v
The value to convert.