Doing a test import into firebase (not a full time developer here) and very new to Firebase and node.js I'm importing the following file and I'm getting the error below after it.
{ "__collections__": { "scores": { "comment": "test comment", "companyId": "ec24fmJeLA93l5jWPAN0", "date": 1607770800.00, "email": "bdavis@wftst.com", "score": 3, "tags": [ "Supervisor Issues", "Communication Issues" ], "userId": "a8waViyRAJWGr2h6Gc3u", "__collections__": {} } }
I'm getting the following error on my terminal after I run the import.
*JSONError: Unexpected token ":" (0x3A) in JSON at position 30 while parsing near "...ctions__\": \n\"scores\": {\n \"comment\": \"..." in TEST_BDAVIS.json
1 | {
2 | "__collections__":
> 3 | "scores": {
| ^
4 | "comment": "test comment",
5 | "companyId": "ec24fmJeLA93l5jWPAN0",
6 | "date": 1607770800.00,
JSONError: Unexpected token ":" (0x3A) in JSON at position 30 while parsing near "...ctions__\": \n\"scores\": {\n \"comment\": \"..." in TEST_BDAVIS.json
1 | {
2 | "__collections__":
> 3 | "scores": {
| ^
4 | "comment": "test comment",
5 | "companyId": "ec24fmJeLA93l5jWPAN0",
6 | "date": 1607770800.00,
at module.exports (/usr/local/lib/node_modules/node-firestore-import-export/node_modules/parse-json/index.js:29:21)
at parse (/usr/local/lib/node_modules/node-firestore-import-export/node_modules/load-json-file/index.js:15:9)
at Object.module.exports [as default] (/usr/local/lib/node_modules/node-firestore-import-export/node_modules/load-json-file/index.js:18:47)*
In the JSON you provided, it seems that a }
is missing. Where should your entire file end, as well as your first __collections__
and scores
section? That may be the cause of the error.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.