I use mongoimport to put data in my mongodb. The original data don't have timestamp and I would like to keep track of created and updated value.
I try to add a field from the mongo CLI and it works with :
db.test.update({}, {$set : {"foo":1}}, {upsert:false, multi:true})
But at the end I would like to add fields above (created updated) with a default: Date.now() if the fields doesn't exist in case of importing another batch of data.
I can figure it out. Or if you have another way to do this. Thanks !
at the end I would like to add fields?