blob: 95b1ceb0e9563a6619bc03c7c8d0c0332ade1190 [file] [log] [blame]
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"></meta><title>FlattenJson</title><link rel="stylesheet" href="../../../../../css/component-usage.css" type="text/css"></link></head><script type="text/javascript">window.onload = function(){if(self==top) { document.getElementById('nameHeader').style.display = "inherit"; } }</script><body><h1 id="nameHeader" style="display: none;">FlattenJson</h1><h2>Description: </h2><p>Provides the user with the ability to take a nested JSON document and flatten it into a simple key/value pair document. The keys are combined at each level with a user-defined separator that defaults to '.'. This Processor also allows to unflatten back the flattened json. It supports four kinds of flatten mode such as normal, keep-arrays, dot notation for MongoDB query and keep-primitive-arrays. Default flatten mode is 'keep-arrays'.</p><h3>Tags: </h3><p>json, flatten, unflatten</p><h3>Properties: </h3><p>In the list below, the names of required properties appear in <strong>bold</strong>. Any other properties (not in bold) are considered optional. The table also indicates any default values, and whether a property supports the <a href="../../../../../html/expression-language-guide.html">NiFi Expression Language</a>.</p><table id="properties"><tr><th>Display Name</th><th>API Name</th><th>Default Value</th><th>Allowable Values</th><th>Description</th></tr><tr><td id="name">Separator</td><td>flatten-json-separator</td><td id="default-value">.</td><td id="allowable-values"></td><td id="description">The separator character used for joining keys. Must be a JSON-legal character.<br/><strong>Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)</strong></td></tr><tr><td id="name"><strong>Flatten Mode</strong></td><td>flatten-mode</td><td id="default-value">keep arrays</td><td id="allowable-values"><ul><li>normal <img src="../../../../../html/images/iconInfo.png" alt="Flattens every objects into a single level json" title="Flattens every objects into a single level json"></img></li><li>keep arrays <img src="../../../../../html/images/iconInfo.png" alt="Flattens every objects and keep arrays format" title="Flattens every objects and keep arrays format"></img></li><li>dot notation <img src="../../../../../html/images/iconInfo.png" alt="Conforms to MongoDB dot notation to update also nested documents" title="Conforms to MongoDB dot notation to update also nested documents"></img></li><li>keep primitive arrays <img src="../../../../../html/images/iconInfo.png" alt="Flattens every objects except arrays which contain only primitive types (strings, numbers, booleans and null)" title="Flattens every objects except arrays which contain only primitive types (strings, numbers, booleans and null)"></img></li></ul></td><td id="description">Specifies how json should be flattened/unflattened</td></tr><tr><td id="name"><strong>Ignore Reserved Characters</strong></td><td>ignore-reserved-characters</td><td id="default-value">false</td><td id="allowable-values"><ul><li>true</li><li>false</li></ul></td><td id="description">If true, reserved characters in keys will be ignored</td></tr><tr><td id="name"><strong>Return Type</strong></td><td>flatten-json-return-type</td><td id="default-value">flatten</td><td id="allowable-values"><ul><li>flatten</li><li>unflatten</li></ul></td><td id="description">Specifies the desired return type of json such as flatten/unflatten</td></tr><tr><td id="name"><strong>Character Set</strong></td><td>flatten-json-character-set</td><td id="default-value">UTF-8</td><td id="allowable-values"></td><td id="description">The Character Set in which file is encoded</td></tr><tr><td id="name"><strong>Pretty Print JSON</strong></td><td>flatten-json-pretty-print-json</td><td id="default-value">false</td><td id="allowable-values"><ul><li>true</li><li>false</li></ul></td><td id="description">Specifies whether or not resulted json should be pretty printed</td></tr></table><h3>Relationships: </h3><table id="relationships"><tr><th>Name</th><th>Description</th></tr><tr><td>success</td><td>Successfully flattened/unflattened files go to this relationship.</td></tr><tr><td>failure</td><td>Files that cannot be flattened/unflattened go to this relationship.</td></tr></table><h3>Reads Attributes: </h3>None specified.<h3>Writes Attributes: </h3>None specified.<h3>State management: </h3>This component does not store state.<h3>Restricted: </h3>This component is not restricted.<h3>Input requirement: </h3>This component requires an incoming relationship.<h3>System Resource Considerations:</h3>None specified.</body></html>