在 Map/Reduce 中运行 MongoDB 查询
是否可以运行 MongoDB 命令(例如查询)以获取其他数据或在 MongoDB 的 MapReduce 命令中进行更新。是在Map函数中还是在Reduce函数中?
无论如何,这样做完全是荒谬的吗?目前,我有一些使用 MongoDB DBReference 命令引用单独集合的文档。
感谢您的帮助!
Is it possible to run MongoDB commands like a query to grab additional data or to do an update from with in MongoDB's MapReduce command. Either in the Map or the Reduce function?
Is this completely ludicrous to do anyways? Currently I have some documents that refer to separate collections using the MongoDB DBReference command.
Thanks for the help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
理论上,这是可能的。在实践中,这存在很多问题。
您基本上是在尝试实现 JOIN 逻辑,而 MongoDB 没有连接。相反,您可能需要通过对几组数据运行几个循环来分几个阶段构建最终数据。
In theory, this is possible. In practice there are lots of problems with this.
You're basically trying to implement JOIN logic and MongoDB has no joins. Instead, you may need to build the final data in a couple of phases by running a few loops on a few sets of data.