我有这些MongoDB文件.在JSON中:
{
"attString":"hello World0",
"attInt":0,
"attDate":new Date("1990-7-20")
}
Run Code Online (Sandbox Code Playgroud)
如何使用mongoimport?将此文档导入MongoDB ?我的attDate字段有问题.
这是MongoDB shell的通知:
失败:文档#1上的错误解组字节:意外的ISODate格式
Roh*_*ain 21
您必须在JSON中更改日期格式
或
{"attString":"hello World0","attInt":0,"attDate":ISODate("2013-11-20T23:32:18Z")}
Run Code Online (Sandbox Code Playgroud)
要么
{"attString":"hello World0","attInt":0,"attDate":{$date:"2013-11-20T23:32:18Z"}}
Run Code Online (Sandbox Code Playgroud)
希望它会有所帮助
| 归档时间: |
|
| 查看次数: |
10614 次 |
| 最近记录: |