这是我的json文件:
{"_id":3,"date_created":"2016-01-01T00:00:00Z","date_updated":"2016-01-01T00:00:00Z","name":"Computers","slug":"Computers","description":"Computers","meta_description":"Computers","meta_keyword":"Computers","navigation":"true","top_id":3,"top":"true","parent_id":2,"parent":"Default","active":"y","iscrawlable":"n","productype":"simple","path":"Computers","categoryids":"2,3","children":"yes","ebaycat":58058},
{"_id":4,"date_created":"2016-01-01T00:00:00Z","date_updated":"2016-01-01T00:00:00Z","name":"Home & Office","slug":"Home & Office","description":"Home & Office","meta_description":"Home & Office","meta_keyword":"Home & Office","navigation":"true","top_id":4,"top":"true","parent_id":2,"parent":"Default","active":"y","iscrawlable":"n","productype":"simple","path":"Home & Office","categoryids":"2,4","children":"yes","ebaycat":0},
{"_id":5,"date_created":"2016-01-01T00:00:00Z","date_updated":"2016-01-01T00:00:00Z","name":"Entertainment","slug":"Entertainment","description":"Entertainment","meta_description":"Entertainment","meta_keyword":"Entertainment","navigation":"true","top_id":5,"top":"true","parent_id":2,"parent":"Default","active":"y","iscrawlable":"n","productype":"simple","path":"Entertainment","categoryids":"2,5","children":"yes","ebaycat":550},
{"_id":6,"date_created":"2016-01-01T00:00:00Z","date_updated":"2016-01-01T00:00:00Z","name":"Motors","slug":"Motors","description":"Motors","meta_description":"Motors","meta_keyword":"Motors","navigation":"true","top_id":6,"top":"true","parent_id":2,"parent":"Default","active":"y","iscrawlable":"n","productype":"simple","path":"Motors","categoryids":"2,6","children":"yes","ebaycat":0},
{"_id":7,"date_created":"2016-01-01T00:00:00Z","date_updated":"2016-01-01T00:00:00Z","name":"Fashion","slug":"Fashion","description":"Fashion","meta_description":"Fashion","meta_keyword":"Fashion","navigation":"true","top_id":7,"top":"true","parent_id":2,"parent":"Default","active":"y","iscrawlable":"n","productype":"simple","path":"Fashion","categoryids":"2,7","children":"yes","ebaycat":3082},
{"_id":8,"date_created":"2016-01-01T00:00:00Z","date_updated":"2016-01-01T00:00:00Z","name":"Health","slug":"Health","description":"Health","meta_description":"Health","meta_keyword":"Health","navigation":"true","top_id":8,"top":"true","parent_id":2,"parent":"Default","active":"y","iscrawlable":"n","productype":"simple","path":"Health","categoryids":"2,8","children":"yes","ebaycat":0},
{"_id":9,"date_created":"2016-01-01T00:00:00Z","date_updated":"2016-01-01T00:00:00Z","name":"Electronics","slug":"Electronics","description":"Electronics","meta_description":"Electronics","meta_keyword":"Electronics","navigation":"true","top_id":9,"top":"true","parent_id":2,"parent":"Default","active":"y","iscrawlable":"n","productype":"simple","path":"Electronics","categoryids":"2,9","children":"yes","ebaycat":279},
使用Jsonlint.com我不断收到错误
第22行的解析错误:..." ebaycat":58058},{" _id":4,
---------------------- ^期待' EOF'
并关注此区域的错误
},
{
当我从文件函数中使用MongoVue导入json文档时会发生类似的情况。
对验证工具(具有修复功能)的任何帮助或参考都表示赞赏。
答案 0 :(得分:3)
您有几个由{...}
表示的对象
这些对象应该在另一个对象或数组上。删除您的上一个逗号,
并用[ ]
覆盖整个内容,将其解析为对象数组。
修改强>
刚看到MongoVUE
。然后简单地把所有文件都没有逗号,如
{..}
{..}
并尝试