美文网首页
JSONPath基本语法

JSONPath基本语法

作者: E术家 | 来源:发表于2023-07-13 17:36 被阅读0次

    JSONPath调试地址

    { "store": {
        "book": [ 
          { "category": "reference",
            "author": "Nigel Rees",
            "title": "Sayings of the Century",
            "price": 8.95
          },
          { "category": "fiction",
            "author": "Evelyn Waugh",
            "title": "Sword of Honour",
            "price": 12.99
          },
          { "category": "fiction",
            "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
        }
      }
    }
    

    $ 根节点
    $.store.book 获取book节点
    $..bicycle 获取根节点下所有bicycle的节点
    $.store.book[0].price 获取第一个book节点下的price
    $.store.book[*].price 获取所有book节点下的price
    更多语法

    相关文章

      网友评论

          本文标题:JSONPath基本语法

          本文链接:https://www.haomeiwen.com/subject/hcwmudtx.html