Output JSON as embedded object

asked 2018-03-21 10:50:46 -0600

Gent gravatar image

Hi,

I'm trying to create an output with embedded object on it, or a filed with a ArrayList inside my output record: Let say we have this example :

[{ "id" : 1, "userName" : "John" "userLastName" : "Smith", "orderID" : "123", "otherOrderInfo" : "aaaaaa" }, { "id" : 1, "userName" : "John" "userLastName" : "Smith", "orderID" : "321", "otherOrderInfo" : "bbbbb" }]

As you can see, the data is coming from a JDBC database on raws, and in the example above the userid:1 has 2 orders 123 and 321, and I want to change a bit the format of my document :

[{ "id" : 1, "userName" : "John" "userLastName" : "Smith", "orders" : [ { "orderID" : 123, "otherOrderInfo" : "aaaaaa" }, { "orderID" : 321, "otherOrderInfo" : "bbbbb" } ] }]

As you can see, the output I'm looking for contains a field orders which is an array list of object orders.

Could you suggest me with any idea, how can I do it in stramsets?

Regards, Gent

edit retag flag offensive close merge delete