Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Array with single element is not getting populated within []

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

Labels (2)
2 Replies
Anonymous
Not applicable
Author

Hi,
Could you please post your  tMongoDBOutput component setting screenshot into forum?
Best regards
Sabrina
Anonymous
Not applicable
Author

Hi Sabrina,

PFB the settings screenshots, and please let me know if any further info required.


0683p000009MFrv.jpg


0683p000009MFuo.jpg


0683p000009MFuQ.jpg


Thanks in advance,
Kind regards,
Sathish