Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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
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"
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.
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