Change String date to ISO date in MongoDB?
问题 In MongoDB, I have a document with a field called "date" and that is in array. { "_id" : ObjectId("587627a2125a730f78a20859"), "data" : [ { "Number" : "359983007479839", "date" : "2016-02-10T21:56:33.000Z" } ] after that I run this script: db.dummy.find().forEach(function(doc){ doc.mongodbdate = ISODate(doc.mongodbdate); db.dummy.save(doc); }) And its giving me below output; { "_id" : ObjectId("588724ba2746360c04a51e4b"), "data" : [ { "Number" : "359983007479839", "mongodbdate" : "2016-02