【发布时间】:2020-05-28 23:21:53
【问题描述】:
我在 Windows 10 上。我最近通过网络抓取获得了一个大型 JSON 文件 (200 MB),我现在正尝试通过导入数据按钮使用 Compass Community 将该文件导入 MongoDB。但是,每当我尝试导入文件时,都会收到以下错误:
Unexpected token l in JSON at position 0 while parsing near 'l
这是我尝试导入的 JSON 文件的前几行:
{
"bands": [{
"activity": "Split-up",
"bandMembers": ["https://www.metal-archives.com/artists/Jon_Powlowski/760544", "https://www.metal-archives.com/artists/Ruben_Martinez/760545", "https://www.metal-archives.com/artists/Greg_Eickmier/416646", "https://www.metal-archives.com/artists/Nedwob/471955"],
"bandName": "A // Solution",
"country": "United States",
"dateAdded": "2018-08-04",
"genre": "Crust Punk/Thrash Metal",
"label": {
"labelName": "Voltic Records",
"labelUrl": "https://www.metal-archives.com/labels/Voltic_Records/47794"
},
"location": "California",
"lyricalThemes": "N/A",
"releases": [{
"numReviews": 0,
"releaseName": "Butterfly",
"reviewAverage": null,
"type": "EP",
"url": "https://www.metal-archives.com/albums/A_--_Solution/Butterfly/723154",
"year": "1989"
}, {
"numReviews": 0,
"releaseName": "Things to Come",
"reviewAverage": null,
"type": "EP",
"url": "https://www.metal-archives.com/albums/A_--_Solution/Things_to_Come/723155",
"year": "1995"
}
],
"similarArtists": null,
"url": "https://www.metal-archives.com/bands/A_--_Solution/3540442600",
"yearFormed": "N/A",
"yearsActive": "N/A"
}, {
"activity": "Active",
有人知道如何解决这个错误吗?
编辑:我在重新启动 Compass 后再次运行导入并得到了这个:
Unexpected token : in JSON at position 0 while parsing near ': null,
这个错误与另一个错误有关系吗?
【问题讨论】:
标签: json mongodb import mongodb-compass