Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear Team,
I am trying to insert a json document with arrays into the target mongoDB and the issue I am facing is array with one element is not getting enclosed within square brackets whereas array with more than one element is working fine.
Please find below the sample data for more understanding.
Current output
Array with single element
--------------------------
"translations" :
{
"language" : "nl",
"colorName" : "B1.10.25 (Kleur Selectie 2002)",
"hue" : null,
"sensation" : null
}
Array with multiple elements
-----------------------------
"translations" :
[
{
"language" : "nl",
"colorName" : "B2.10.25 (Kleur Selectie 2002)",
"hue" : null,
"sensation" : null
},
{
"language" : "bef",
"colorName" : "B3.10.25 (Kleur Selectie 2002)",
"hue" : null,
"sensation" : null
}
]
Expected output
Array with single element
--------------------------
"translations" :
[
{
"language" : "nl",
"colorName" : "B2.10.25 (Kleur Selectie 2002)",
"hue" : null,
"sensation" : null
}
]
I am using talend open studio for big data 6.2.1 and the component is tMongoDBOutput. In the component I am using "translations" as loop element and tried defining attributes such as array and object but still not working.
Kindly need your assistance and please let me know if any further info required.
Thanks in advance.
Kind regards,
Sathish