Bobby
Bobby

Reputation: 189

Pentaho Data Integration Auto Create Date Created and Last Updated

I am trying to create a job to insert all my data from Mysql to MongoDB

pentaho

and this is my configuration :

configuration

how to auto generate date_created and last_updated?

so every data insert will auto fill date_created to new Date() or current date time and every data updated will auto update field last_updated with new Date() or current date.

Upvotes: 0

Views: 2823

Answers (1)

AlainD
AlainD

Reputation: 6356

You are looking for the Get System Info step.

It gives you a number of variables realted to the environement, including the time of the run. I usually use the system date (fixed), so that all the date-created are the same for the run, which ease retrieval.

For the last_update, it is that same technique, if you can setup your Match field for update in the MongoDB output step. If you cannot, have a look at the Merge Row (diff) : it tells you if the record is new, deleted, identical or changed.

enter image description here

Upvotes: 1

Related Questions