簡體   English   中英

Firebase JSON 導入錯誤 意外令牌“:”

[英]Firebase JSON import error Unexpected token “:”

對 firebase(這里不是全職開發人員)進行測試導入,並且對 Firebase 和 node.js 非常陌生,我正在導入以下文件,但我得到了下面的錯誤。

 { "__collections__": { "scores": { "comment": "test comment", "companyId": "ec24fmJeLA93l5jWPAN0", "date": 1607770800.00, "email": "bdavis@wftst.com", "score": 3, "tags": [ "Supervisor Issues", "Communication Issues" ], "userId": "a8waViyRAJWGr2h6Gc3u", "__collections__": {} } }

運行導入后,我的終端上出現以下錯誤。

*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)*

在您提供的 JSON 中,似乎缺少} 你的整個文件應該在哪里結束,以及你的第一個__collections__scores部分? 這可能是錯誤的原因。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM