我正在mongodb中尝试这个命令:
db.runCommand ( { distinct: "user", key: "city" } )得到了正确的数据。
我想把这个命令传给骡子。我正在我的骡子流中尝试这个:
<mongo:execute-command config-ref="Mongo_DB_Go" doc:name="Mongo DB" database="test" username="${db.user}" commandName="distinct" commandValue='{distinct : "user", key : "city" }'/>发布于 2016-03-06 12:55:24
<mongo:execute-command config-ref="Mongo_DB" commandName="eval" commandValue="db.runCommand({distinct: "user", key: "city"})" doc:name="Mongo DB"/>这可能是过度工程,但是我找到的最快的解决方案。
发布于 2016-02-19 07:17:53
该连接器的文档和示例有点缺乏,以下是它应该如何实现的方式:
<mongo:execute-command config-ref="Mongo_DB" commandName="distinctCommand" doc:name="Mongo DB" commandValue="function(){db.runCommand ( { distinct: "user", key: "city" } )}"/>https://stackoverflow.com/questions/35498601
复制相似问题