我正在使用jsonpath.com尝试使用电子邮件地址作为KEY。
所以我的数据可能看起来像这样:
"phoneNumbers": [
{
"type" : "iPhone",
"[email protected]": 123456,
"number": "0123-4567-8888"
},
但是,我无法引用该电子邮件地址:
$.phoneNumbers[0]['type'] // iPhone
$.phoneNumbers[0]['number'] // 0123-4567-8888
$.phoneNumbers[0]['[email protected]'] // no match
$.phoneNumbers[0]['bob\@gmail.com'] // no match
$.phoneNumbers[0]['bob\@gmail\.com'] // no match
我如何使用电子邮件地址指定jsonPath密钥?
问题出在点上.com
。看到这个答案。似乎应该可以这样做$.phoneNumbers[0]['[email protected]']
,但不能在jsonpath.com上进行
该答案中的关键声明:
jsonpath.com基于JSONPath的过时版本,对于预览当前库将为您提供的内容并不可靠。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句