不规则数据列如何使用jsonpath?
回答
收藏

不规则数据列如何使用jsonpath?

j
jerry83
2023-09-22 15:28·浏览量:172
j
jerry83
发布于 2023-09-22 15:28172浏览

下方是数据组,第二个数组缺少"category",如果使用jsonpath,结果如下,此种情况下,数据写入表格会出现本来是第三项的fiction变成第二项。如何让第二项category为空?

{ "store": {

   "book": [

     { "category": "reference",

       "author": "Nigel Rees",

       "title": "Sayings of the Century",

       "price": 8.95

     },

     {

       "author": "Herman Melville",

       "title": "Moby Dick",

       "isbn": "0-553-21311-3",

       "price": 8.99

     },

     { "category": "fiction",

       "author": "J. R. R. Tolkien",

       "title": "The Lord of the Rings",

       "isbn": "0-395-19395-8",

       "price": 22.99

     }

   ],

   "bicycle": {

     "color": "red",

     "price": 19.95

   }

 }

}

收藏
全部回答1
最新
发布回答
回答