I have this MongoDB document. In JSON:
{
"attString":"hello World0",
"attInt":0,
"attDate":new Date("1990-7-20")
}
How can I import this document into MongoDB using mongoimport
? I have a problem with the attDate field.
This is MongoDB shell notice:
Failed: error unmarshaling bytes on document #1: unexpected ISODate format
You have to change your date format in JSON
Either
{"attString":"hello World0","attInt":0,"attDate":ISODate("2013-11-20T23:32:18Z")}
OR
{"attString":"hello World0","attInt":0,"attDate":{"$date":"2013-11-20T23:32:18Z"}}
Hope it will help
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With