繁体   English   中英

MongoDB 到 MongoDB 文档迁移与 Pentaho

[英]MongoDB to MongoDB document migration with Pentaho

我在 DB01,MongoDb 中有这样的文件

在此处输入图像描述 我想在其他 MongoDB 中更新此文档,查看文档中的密钥(_id)。

我的 Pentaho 工作非常简单: 在此处输入图像描述

您可以看到我正确获取了数据。例如,如何使用查找 _id 的键更新整个文档?

提前致谢。

问候!

在您的“MongoDB 输入”预览中,我看到您的记录具有正确的“_id”值。 好的,现在您只需要在“MongoDB 输入”步骤中使用 select 所有字段而不是“输出单个 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. 

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM