1、String字符串转ISODate
db.aj_hy_copy.find().forEach(function(doc) {
doc.许可证有效期起始日期=new Date(doc.许可证有效期起始日期);
db.aj_hy_copy.save(doc);
})
2、ISODate转时间戳
db.aj_hy.find().forEach(function(doc) {
doc.许可证有效期截止日期=doc.许可证有效期截止日期.valueOf();
db.aj_hy.save(doc);
})
db后面是表名。doc.后面的是要更改的字段