JSON Path使用说明

表达式说明

目前JSONPath仅支持链装调用

  • $ 表示文档的根元素
  • .nodeName[nodeName] 表示匹配下级节点

示例

{
  "firstName": "John",
  "lastName" : "doe",
  "age"      : 26,
  "address"  : {
    "streetAddress": "naist street",
    "city"         : "Nara",
    "postalCode"   : "630-0192"
  },
  "phoneNumbers": [
    {
      "type"  : "iPhone",
      "number": "0123-4567-8888"
    },
    {
      "type"  : "home",
      "number": "0123-4567-8910"
    }
  ]
}
表达式:$.firstName 值:"John"
表达式:$.age 值:26
表达式:$.phoneNumbers[:1].type 值:"iPhone"
© 2007-2023 北京基调网络股份有限公司 all right reserved,powered by Gitbook本文档更新于: 2023-12-19 10:14

results matching ""

    No results matching ""