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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
tnewbie
Creator II
Creator II

Issues with tMongoDBRow

Hello All,

I have a need to add records to an array in a Mongo Collection arry_test2. I am able to do it seamlessly from my Mongoshell but when I am trying to do the same from tMongoDBRow, it is giving me an error code 59. Not sure if I am missing on any syntax options/switches. Please share your thoughts and observations.

Collection:

db.arry_test2.insert([

{  

   "id": "0001",  

   "type": "donut",  

   "name": "Cake",  

   "ppu": 0.55,  

   "batters":  

      {  

        "batter":  

           [  

             { "id": "1001", "type": "Regular" },  

             { "id": "1002", "type": "Chocolate" },  

             { "id": "1003", "type": "Blueberry" },  

             { "id": "1004", "type": "Dev's Food" }  

           ]  

      },  

   "topping":  

      [  

        { "id": "5001", "type": "None" },  

        { "id": "5002", "type": "Glazed" },  

        { "id": "5005", "type": "Sugar" },  

        { "id": "5007", "type": "Powdered Sugar" },  

        { "id": "5006", "type": "Chocolate with Sprinkles" },  

        { "id": "5003", "type": "Chocolate" },  

        { "id": "5004", "type": "Maple" }  

      ]  

 } ]);

Command to update Document/ Insert records to Array, that works fine from MongoShell:

db.arry_test2.update({id:"0001"},{$addToSet:{"batters.batter":{'id':"100001",'type':"regular food"}}});

Please check the attached talend job snippet

Labels (3)
1 Solution

Accepted Solutions
angamuthu1
Contributor II
Contributor II

Looks like Execute command is deprecated in version Mongo4.x, I was able to get over the issue using 'Construct command from a JSON string'... Thanks everyone

View solution in original post

3 Replies
tnewbie
Creator II
Creator II
Author

Any thoughts on this request please

angamuthu1
Contributor II
Contributor II

Looks like Execute command is deprecated in version Mongo4.x, I was able to get over the issue using 'Construct command from a JSON string'... Thanks everyone

Anonymous
Not applicable

Hello,

Thanks for letting us know you have resolved this issue by yourself.

Best regards

Sabrina