我在mongodb中尝试这个命令:
db.runCommand ( { distinct: "user", key: "city" } )
并获得了适当的数据。
我想在mule中传递此命令。我在我的骡子流中尝试这个:
<mongo:execute-command config-ref="Mongo_DB_Go" doc:name="Mongo DB" database="test" username="${db.user}" commandName="distinct" commandValue='{distinct : "user", key : "city" }'/>
答案 0 :(得分:0)
该连接器的文档和示例有点缺乏,以下是应该如何:
<mongo:execute-command config-ref="Mongo_DB" commandName="distinctCommand" doc:name="Mongo DB" commandValue="function(){db.runCommand ( { distinct: "user", key: "city" } )}"/>
答案 1 :(得分:0)
<mongo:execute-command config-ref="Mongo_DB" commandName="eval" commandValue="db.runCommand({distinct: "user", key: "city"})" doc:name="Mongo DB"/>
它可能是过度工程,但却是我得到的最快的解决方案。