For example I want to update all records to \'2012-01-01\' ( \"time\" : ISODate(\"2011-12-31T13:52:40Z\") ).
db.test.update( { time : \'2012-01-01\' }, false,
You can do this in the old-school way by creating ISO date
db.test.update({_id : 1}, {
$set : {
"time" : new ISODate("your current date")
}
});
But note that with new Mongo 2.6
you will be able to update date to a current date really easy with $currentDate.
db.test.update( { _id: 1 }, {
$currentDate: {
time: true,
},
})