标签: pentaho-spoon pentaho-data-integration
我正在尝试创建一个作业,以插入Mysql to MongoDB中的所有数据
Mysql to MongoDB
这是我的配置:
如何自动生成date_created和last_updated?
date_created
last_updated
因此,每个data insert都将date_created自动填充到new Date()或当前日期时间,每个data updated都将使用last_updated自动更新字段new Date()或当前日期。
data insert
new Date()
data updated
答案 0 :(得分:1)
您正在寻找Get System Info步骤。
Get System Info
它为您提供了许多与环境有关的变量,包括运行时间。我通常使用system date (fixed),以便所有创建的日期在运行中都是相同的,这样便于检索。
system date (fixed)
对于last_update,如果可以在Match field for update步骤中设置MongoDB output,则使用相同的技术。如果不能,请查看Merge Row (diff):它会告诉您记录是新记录,已删除记录,相同记录还是已更改。
last_update
Match field for update
MongoDB output
Merge Row (diff)