When I export my data from mongoDB I obtain the following file:
Everything is a string in the mongoDB except for the date that is ISODate.
[email protected],sha1:64000:18:BTJnM903gIt5FNlSsZIRx1tLC9ErPJuB:9YVs800sgRPr1aaLj73qqnJ6,123,123,[email protected],2017-04-28T09:20:07.480Z,cus_AYcVXIUf68nT52
If I import this file into MongoDB it import each value as String value. I need to parse the date as Date format, the rest can be string.
I've seen that there's an argument for MongoImport --columnsHaveTypes. I've tryed it without any result:
mongoimport -u test-p test --authenticationDatabase test -h localhost:30158 --db test--collection users --type csv --file users.csv --upsert --upsertFields username --fields username.string\(\),password.string\(\),cname.string\(\),sname.string\(\),mail.string\(\),creation.date\(\),validation.auto\(\),clients.string\(\),customer.string\(\) --columnsHaveTypes
I get this error:
Failed: type coercion failure in document #0 for column 'creation', could not parse token '2017-04-28T09:20:07.480Z' to type date
What I could do?
Kind regards.