aboutsummaryrefslogtreecommitdiffstats
path: root/dcae-analytics-cdap-plugins/docs/JsonPathFilter-transform.md
diff options
context:
space:
mode:
authoran4828 <nekrassov@att.com>2017-08-21 11:05:08 -0400
committerLusheng Ji <lji@research.att.com>2017-08-24 00:56:45 +0000
commite86be39dc5ff812b73398e0720aa3fbf0c48213c (patch)
treefe3198f180128163490c14c66a1d6074760b220b /dcae-analytics-cdap-plugins/docs/JsonPathFilter-transform.md
parentff6a13c7ce03ec95fba9d0b4f04b74d0bfeb6a47 (diff)
Initial TCA commit into DCAEGEN2
Change-Id: I5f7f8af2a00419854cafc34b79277df60d1af095 Issue-ID: DCAEGEN2-53 Signed-off-by: an4828 <nekrassov@att.com>
Diffstat (limited to 'dcae-analytics-cdap-plugins/docs/JsonPathFilter-transform.md')
-rw-r--r--dcae-analytics-cdap-plugins/docs/JsonPathFilter-transform.md42
1 files changed, 42 insertions, 0 deletions
diff --git a/dcae-analytics-cdap-plugins/docs/JsonPathFilter-transform.md b/dcae-analytics-cdap-plugins/docs/JsonPathFilter-transform.md
new file mode 100644
index 0000000..ec9bb20
--- /dev/null
+++ b/dcae-analytics-cdap-plugins/docs/JsonPathFilter-transform.md
@@ -0,0 +1,42 @@
+# JSON Path Filter
+
+## Description
+
+Filters incoming JSON based on given filter mappings.
+
+The mappings in the plugin will be:
+
+ +================================================+
+ | JSON Path Expression | Expected Values |
+ |---------------------------|--------------------|
+ |$.employee.name.first | rajiv;manjesh |
+ |$.employee.name.last | singla;gowda |
+ |$.employee.email | johndoe@xyz.com |
+ +================================================+
+
+The above filter mappings will inside json path $.employee.name.first and check if value matches rajiv or manjesh.
+Only if path does exist and matches any of the expected values rajiv or manjesh then first filter mapping will be true.
+
+If multiple mappings are provided all mapping must be true for result to be matched.
+
+If incoming json is null or empty then output result will be null as no matching is possible.
+
+### Expression
+
+The "root member object" for parsing any JSON is referred to as ```$```, regardless of
+whether it's an array or an object. It also uses either dot notation or bracket notation for
+defining the levels of parsing. For example: ```$.employee.name``` or ```$[employee][name]```.
+
+#### Supported Operators
+
+These operators are supported:
+
+ +========================================================================+
+ | Operator | Description |
+ |-------------------|----------------------------------------------------|
+ | $ | The root element of the query |
+ | * | Wildcard |
+ | .. | Deep scan |
+ | .<name> | Dot notation representing child |
+ | [?(<expression>)] | Filter expression, should be boolean result always |
+ +========================================================================+