Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I'm using Talend OS for Big Data 6.4.0 and MongoDB . Now, I was trying to pull the ALM defect data (all the columns) and storing the data into DB. i want to get all the column details from defect without specifying the names in tExtractXMLFiled OR tExtractJsonFiled XPath mapping. So that, i have directly stored the json response in DB.
Here My Job Detail:
tRestClient --> response --> tMongoDBOutput
In the above job, directly storing the REST API response in mongodb as a json format.
Actual Output:
{
"_id" : ObjectId("5ba38c8d52460b21c7f97e69"),
"string" : "{\"entities\":[{\"Fields\":[{\"Name\":\"detection-version\",\"values\":[{}]},{\"Name\":\"subject\",\"values\":[]},{\"Name\":\"description\",\"values\":[{\"value\":\"<html><body> \\n<div align=\\\"left\\\" style=\\\"min-height:9pt\\\">\\n<font face=\\\"Arial\\\"><span dir=\\\"ltr\\\" style=\\\"font-size:8pt\\\">When I'm trying to load the iDashboard application, some time it is showing blank page instead of login page.</span></font>\\n</div> \\n</body></html>\"}]},{\"Name\":\"target-rcyc\",\"values\":[{}]},{\"Name\":\"project\",\"values\":[{}]},{\"Name\":\"has-linkage\",\"values\":[{\"value\":\"N\"}]},{\"Name\":\"last-modified\",\"values\":[{\"value\":\"2018-09-06 07:33:06\"}]},{\"Name\":\"has-others-linkage\",\"values\":[{\"value\":\"N\"}]},{\"Name\":\"attachment\",\"values\":[{}]},{\"Name\":\"cycle-id\",\"values\":[]},{\"Name\":\"request-type\",\"values\":[{}]},{\"Name\":\"creation-time\",\"values\":[{\"value\":\"2018-09-06\"}]},{\"Name\":\"actual-fix-time\",\"values\":[]},{\"Name\":\"id\",\"values\":[{\"value\":\"1\"}]},{\"Name\":\"run-reference\",\"values\":[]},{\"Name\":\"request-note\",\"values\":[{}]},{\"Name\":\"request-server\",\"values\":[{}]},{\"Name\":\"severity\",\"values\":[{\"value\":\"1-Low\"}]},{\"Name\":\"to-mail\",\"values\":[{}]},{\"Name\":\"owner\",\"values\":[{\"value\":\"prakash\"}]},{\"Name\":\"detected-by\",\"values\":[{\"value\":\"pra\"}]},{\"Name\":\"step-reference\",\"values\":[]},{\"Name\":\"estimated-fix-time\",\"values\":[]},{\"Name\":\"reproducible\",\"values\":[{\"value\":\"Y\"}]},{\"Name\":\"ver-stamp\",\"values\":[{\"value\":\"1\"}]},{\"Name\":\"request-id\",\"values\":[]},{\"Name\":\"priority\",\"values\":[{\"value\":\"2-Medium\"}]},{\"Name\":\"cycle-reference\",\"values\":[{}]},{\"Name\":\"environment\",\"values\":[{}]},{\"Name\":\"target-rel\",\"values\":[{}]},{\"Name\":\"test-reference\",\"values\":[]},{\"Name\":\"planned-closing-ver\",\"values\":[{}]},{\"Name\":\"extended-reference\",\"values\":[{}]},{\"Name\":\"dev-comments\",\"values\":[{}]},{\"Name\":\"detected-in-rcyc\",\"values\":[{}]},{\"Name\":\"closing-version\",\"values\":[{}]},{\"Name\":\"name\",\"values\":[{\"value\":\"iDashboard application not loading properly in Production instance\"}]},{\"Name\":\"has-change\",\"values\":[{}]},{\"Name\":\"detected-in-rel\",\"values\":[{}]},{\"Name\":\"status\",\"values\":[{\"value\":\"New\"}]},{\"Name\":\"closing-date\",\"values\":[]}],\"Type\":\"defect\",\"children-count\":0}],\"TotalResults\":1}"
}
But i need to store the data like below,
Expected Result:
{
"_id" : ObjectId("596e69f9a2e6f23e28ba0d58"),
"summary" : "test",
"severity" : "2-Medium",
"priority" : "2-Medium",
"status" : "New",
"creation-time" : ISODate("2018-01-08T00:00:00.000+0000"),
"closing-date" : null,
"description" : "",
"owner" : "prakash",
"id" : NumberInt(339)
}
How can i store the data like expected result?
Or Else
Is it possible to store the expected result in DB with help of tExtractXMLFiled OR tExtractJsonFiled?If yes, How can i retrieve the data without specify the column names in XPath or JsonPath query?
Hello,
Please try to extract file through tRESTClient component and use tExtractJSONFields component.
Here is online component reference about:https://help.talend.com/reader/WfrS1ZaBst3az8zJBGoMSQ/4ZTpN_SyZv~p8f1UpHWfNQ
Best regards
Sabrina