storejson

Table of Contents

Prototype: storejson(data_container)

Return type: string

Description: Converts a data container to a JSON string.

This function can accept many types of data parameters.

Arguments:

  • data_container: string, in the range: .*

Example:

   vars:

      "loadthis"
         data =>  readjson("/tmp/data.json", 4000);
      "andback"
         string =>  storejson(loadthis);
   reports:
      "Converted /tmp/data.json to '$(andback)'";

History: The collecting function behavior was added in 3.9.

See also: readjson(), readyaml(), parsejson(), parseyaml(), about collecting functions, and data documentation.