I have joined Countries to Locations in the HR Sample database in OracleXE.
I am then using a tMap to generate a nested JSON document.

it works, but for some reason null values in the Location are coming through as arrays in the final output in the console (have also tried MongoDB).

I believe the elegant (and short) solution would be the following.
Talend docs state that:
When configuring a JSON tree, the default type of an element is string. If an element is not of type string, you need to add an attribute for the element to set its type.
So, to the object receiving a null value, you should add an attribute named class and set its static value to object.
Pic: JSON Tree Configuration
And voilà!
PIC: "Complemento":null
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With