mongodb - 使用 Pentaho 进行 MongoDB 到 MongoDB 文档迁移
问题描述
我在 DB01,MongoDb 中有这样的文件
我想在其他 MongoDB 中更新此文档,查看文档中的 key(_id)。
您可以看到我正确获取了数据。例如,如何使用查找 _id 的键更新整个文档?
提前致谢。
问候!
解决方案
在您的“MongoDB 输入”预览中,我看到您的记录具有正确的“_id”值。好的,现在您只需要在“MongoDB 输入”步骤中选择所有字段而不是“输出单个 JSON 字段”。
而且,在“MongoDB 输出”步骤中,您需要在 _Id 的“匹配字段以更新”字段中设置 Y。
我已经为您的Here准备了一个示例转换。
Before run my transformation do the following things:-
First create 2 collection with same '_id ' and different 'qty'.
db.products.insert( { _id: 10, item: "box", qty: 20 } )
db.products2.insert( { _id: 10, item: "box", qty: 2 } )
Take input from db.products and update record on db.products2
only if '_id' is match.
推荐阅读
- angular - Typescript / Angular中具有0个元素的函数返回映射
- python - 为什么我的代码在控制台中运行时运行良好,但在脚本中使用时运行良好?
- machine-learning - 为什么我的机器学习算法会卡住?
- javascript - 可以使用具有真假键或逻辑运算符的对象而不是单个 if else 来降低圈复杂度吗?
- python - BeautifulSoup 中的 find_all() 方法返回空列表
- dotnetnuke - 是否可以在同一 DNN 实例上的门户之间共享 2SXC 内容模块?
- asp.net-core - 动态参数在 Put 方法中不起作用
- java - 使用 EasyMock 在异常后执行断言
- file - 如何在谷歌驱动器中移动快捷方式
- kubernetes - 如何在 Kubernetes Persistent 卷中声明和配置 Bitnami Docker Discourse 数据?