IBM Streams com.ibm.streamsx.json Toolkit > com.ibm.streamsx.json 1.5.1 > com.ibm.streamsx.json > TupleToJSON
This operator converts incoming tuples to JSON String. Note that any matching attributes from the input stream will be copied over to the output. If an attribute, with the same name as the JSON string output attribute exists in the input stream, it will be overwritten by the JSON String that is generated.
Optional: inputAttribute, jsonStringAttribute, prefixToIgnore, rootAttribute
Optional: inputAttribute, jsonStringAttribute, prefixToIgnore, rootAttribute
Input stream attribute to be used as the root of the JSON object. Required type for attribute is tuple, list or set. Default is the input tuple. This parameter specfies the attribute, not its name, and is preferred to the rootAttribute parameter which specifies the attribute's name.
Name of the output stream attribute where the JSON string will be populated. Default is jsonString.
Specifies a string that, if present, is removed from the start of an attribute name.You can use this method for JSON that contains elements or attributes with SPL or C++ keywords.For example:
stream <rstring jsonString> A = TupleToJSON(Input) { param ignorePrefix : "__"; }
This example accepts JSON of the following form:
{"graph" : "value"}
Since graph is an SPL keyword, stream<rstring graph> as input schema of TupleToJSON is not valid SPL.
Deprecated. Name of the input stream attribute to be used as the root of the JSON object. Replaced by parameter inputAttribute which specifies the attribute rather than the attribute's name. Required type is tuple, list or set. Default is the input tuple.