首页 > 解决方案 > 如何在将数据保存到实时数据库时修复firebase json解析错误?

问题描述

在这些 json 字符串到达​​之前,我将数据保存到 firebase realtime db 一切正常。它显示无效的 json 解析

{
   "biz_title":"UCO BANK ATM in Perambakkam",
   "list_price":0,
   "campaign_id":0,
   "phone":"044 2765 5322",
   "biz_c_status":"closed",
   "biz_date":"20-07-19 09:17:28",
   "biz_ads_purchase_packages":null,
   "biz_view_count":0,
   "id":337,
   "biz_modified":"08-09-19 14:07:57",
   "plan_id":0,
   "g_address":"UCO Bank ATM, Perambakkam, Tamil Nadu, India",
   "biz_type":"listing",
   "biz_ads_purchase_date":null,
   "gst_number":null,
   "price_status":"notsay",
   "email":null,
   "biz_reported":null,
   "aadhar_number":null,
   "mappin":null,
   "biz_status":"publish",
   "latitude":13.0391786,
   "biz_logo":null,
   "biz_tagline":null,
   "gallery":null,
   "new_planid":0,
   "list_price_to":0,
   "biz_name":"uco-bank-atm-in-perambakkam",
   "biz_author":1,
   "biz_reported_by":0,
   "longitude":79.81525629999999,
   "contact_person":null,
   "claimed_section":"not_claimed",
   "biz_description":"UCO Bank, formerly United Commercial Bank, established in 1943 in Kolkata, is a major government-owned commercial bank of India. During FY 2013-14, its total business was \u20b9 4.55 lakh crore. Based on 2014 data, it is ranked 1860 on Forbes Global 2000 List. UCO Bank was ranked 294th among India's most trusted brands according to the Brand Trust Report 2014, a study conducted by Trust Research Advisory. It was a rise of 796 ranks considering it was listed at the 1090th position among Indias most trusted brands in the Brand trust Report 2013. As of 30 March 2017 the bank had 4,000 plus service units 49 zonal offices spread all over India. It also has two overseas branches in Singapore and Hong Kong. UCO Bank's headquarters is on BTM Sarani, Kolkata.\r\n\r\n*source: Wikipedia"
}

这是从 firebase 休息请求中获取的结果

{
  "error" : "Invalid data; couldn't parse JSON object, array, or value."
}

标签: jsonfirebasefirebase-realtime-database

解决方案


推荐阅读