无法在MongoDB中导入JSON [英] Cannot import a json in MongoDB
本文介绍了无法在MongoDB中导入JSON的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在Openshift中使用RockMongo在MongoDB数据库中导入json文件.我直接从另一个MongoDB中导出了json,但我没有做任何更改.这是json的一部分:
I am using RockMongo in Openshift to import a json file in MongoDB database. I exported directly the json from another MongoDB and I haven't changed anything. Here is a part of the json:
{ "_id" : "10352",
"author" : "8988607",
"country" : "...",
"views" : 1716,
"title" : "...",
"comments" : 1,
"likes" : 28,
"text" : "...",
"date" : { "$date" : 1278070740000 },
"approved" : "8480596" }
我有此错误消息:
exception: field names cannot start with $ [$date] at src/mongo/shell/collection.js:147
正如我所说,我直接从另一个MongoDB中导出了json.我现在该如何解决这个问题?
As I said, I exported the json directly from another MongoDB. How can I solve this problem now?
推荐答案
我遇到了这个问题,我的dba用\ uFF04代替了美元符号,这为我们解决了问题.
I came up against this problem and my dba replaced the dollar sign with \uFF04 and that did the trick for us.
这篇关于无法在MongoDB中导入JSON的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文