datetime is my user-defined field where i m storing in isodate format. I want add a timestampCreated key to the documents in this collection. I am trying this but its giving error as "error:timestamp must be in number".
var cursor = db.getCollection('test').find();
while (cursor.hasNext()) {
var doc = cursor.next();
db.getCollection('test').update({_id : doc._id}, {$set :
{'timestampCreated' : new Timestamp(new Date('datetime'), 0) }});
}