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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
bglaplante
Contributor III
Contributor III

tMongoDBRow - still using eval ???

This very old post https://community.talend.com/t5/Design-and-Development/How-to-rename-a-MongoDB-collection/td-p/75872

indicated that tMongoDBRow would no longer be using eval, but instead would be using runCommand by version 6.1.  I am on version 7.1.1 and trying the example... I get an error ... error 13 - unauthorized to execute command { $eval: ....

 

Eh?  The admin doesn't want to give eval permission.  Was this not implemented or?

Thank you.

 

I'm on mongoDB 3.6.14

Labels (2)
4 Replies
Anonymous
Not applicable

Hello,

Starting from V 6.1, we have added a new option that uses the "runCommand" feature to execute commands. This ensures the compatibility between different studio versions and the latest as we keep the $eval option and add the new "runCommand" option.

Please have a look at this component reference:https://help.talend.com/reader/JAVIF8qLh6BhZ~e4~IDqtw/Lgd0SPBAv6Mkw~tV_U2~qw 

Here is the related jira issue:https://jira.talendforge.org/browse/TBD-2811 

Best regards

Sabrina

bglaplante
Contributor III
Contributor III
Author

OK, this helps, especially as the link I referenced above says to

Uncheck the 'Execute command' box and type in the command as below

so that's wrong.  I need to check Execute Command in order to use runCommand.

Can you provide a functioning example of a command (proper syntax)?  As

"db.oldname.renameCollection('newName')"

Given in the old answer... results in "no such command"

bglaplante
Contributor III
Contributor III
Author

OK - got a bit further --- the correct syntax would be of form

{ renameCollection: "<source_namespace>", to: "<target_namespace>", dropTarget: <true|false>  writeConcern: <document> }

with the " changed to ' when entering this as "construct command from JSON string" in Talend.

that then fails with a mongo error - rename collection may only be run against the admin database.  A fairly significant limitation, which seems to be in MongoDB.

 

So it appears - without eval permission, there is no way to execute a rename collection with tMongoDBRow in my situation.

Anonymous
Not applicable

Hello,


@bglaplante wrote:

OK - got a bit further --- the correct syntax would be of form

{ renameCollection: "<source_namespace>", to: "<target_namespace>", dropTarget: <true|false>  writeConcern: <document> }

with the " changed to ' when entering this as "construct command from JSON string" in Talend.

that then fails with a mongo error - rename collection may only be run against the admin database.  A fairly significant limitation, which seems to be in MongoDB.

 

So it appears - without eval permission, there is no way to execute a rename collection with tMongoDBRow in my situation.


With your situation, could you please create a jira issue on talend bug tracker?

Best regards

Sabrina