我是在做csv文件里的数据导入到mongodb数据库中,程序要求是数据库中datetime列的类型为ISODate类型。
我要怎么在插入数据库前或者插入后将格式改为ISODate类型???
或者可以用python的pandas模块怎么指定列的类型???
又或者MongoDB 怎么把已经插入的String类型的日期(例:"2017-02-06 21:00:10.500"),改为MongoDB的ISODate类型(例:ISODate("2017-02-06T21:00:10Z"))???跪求解决方法
一个集合名打错
db.tick.find().forEach(function(doc) {
doc.datetime=new IOSDate(doc.datetime);
db.tick.save(doc);
})
pymongo怎么操作改为ISODate类型
已解决:
db.tick.find().forEach(function(doc) {
doc.datetime=new IOSDate(doc.datetime);
db.ClockTime.save(doc);
})