My KTR is:
MongoDB Json Input gives the JSON as follows:
{ "_id" : { "$oid" : "525cf3a70fafa305d949ede0"} , "asset" : "RO2500AS1" , "Salt Rejection" : "82%" , "Salt Passage" : "18%" , "Recovery" : "56.33%" , "Concentration Factor" : "2.3" , "status" : "critical" , "Flow Alarm" : "High Flow"}
And one Table input which returns 2 rows:
In StreamLookUp step, Key to look up is configured as asset = AssetName
My final Output is returning 2 jsons:
{"data":[{"Estimated Cost":"USD 15","AssetName":"RO2500AS1","Description":"Pump Maintenance","Index":1,"json":"{ \"_id\" : { \"$oid\" : \"525cf3a70fafa305d949ede0\"} , \"asset\" : \"RO2500AS1\" , \"Salt Rejection\" : \"82%\" , \"Salt Passage\" : \"18%\" , \"Recovery\" : \"56.33%\" , \"Concentration Factor\" : \"2.3\" , \"status\" : \"critical\" , \"Flow Alarm\" : \"High Flow\"}","Type":"Service","DeadLine":"13 November 2013"}]}
{"data":[{"Estimated Cost":"USD 35","AssetName":"RO2500AS1","Description":"Heat Sensor","Index":2,"json":"{ \"_id\" : { \"$oid\" : \"525cf3a70fafa305d949ede0\"} , \"asset\" : \"RO2500AS1\" , \"Salt Rejection\" : \"82%\" , \"Salt Passage\" : \"18%\" , \"Recovery\" : \"56.33%\" , \"Concentration Factor\" : \"2.3\" , \"status\" : \"critical\" , \"Flow Alarm\" : \"High Flow\"}","Type":"Replacement","DeadLine":"26 November 2013"}]}
I want my final JSON output to merge show result something like:
{"data": [{"Estimated Cost":"USD 15", "AssetName":"RO2500AS1", "Description":"Pump Maintenance", "Index":1, "Type":"Service", "DeadLine":"13 November 2013"}, {"Estimated Cost":"USD 35", "AssetName":"RO2500AS1", "Description":"Heat Sensor", "Index":2, "Type":"Replacement", "DeadLine":"26 November 2013"}],
"json":{ "_id" : "525cf3a70fafa305d949ede0"} , "asset" : "RO2500AS1" , "Salt Rejection" : "82%" , "Salt Passage" : "18%" , "Recovery" : "56.33%" , "Concentration Factor" : "2.3" , "status" : "critical" , "Flow Alarm" : "High Flow"}
which means merging 2 rows.
Can anybody help please