toJsonString

Renders this value as JSON text.

JSON is the format the engine ingests, not the format it stores, and the mapping back is not total: a date, a timestamp, a uuid and a binary all become JSON strings — ISO-8601 for the temporal types, base64 for binary — because JSON has nowhere else to put them. Every type that arrived through JSON returns unchanged, which is the roundtrip the codec guarantees; the rest is an interop and debugging convenience, and reading the result back yields strings.

Throws

for a non-finite double, which JSON cannot express, or for nesting deeper than DEFAULT_MAX_JSON_DEPTH.

if the bytes do not decode.