• jsonpath


    1. java 类库

         jayway/JsonPath 

          maven 使用方法

    <dependency>
        <groupId>com.jayway.jsonpath</groupId>
        <artifactId>json-path</artifactId>
        <version>2.2.0</version>
    </dependency>
    

      jsonpath 语法:

          

    Operators

    OperatorDescription
    $ The root element to query. This starts all path expressions.
    @ The current node being processed by a filter predicate.
    * Wildcard. Available anywhere a name or numeric are required.
    .. Deep scan. Available anywhere a name is required.
    .<name> Dot-notated child
    ['<name>' (, '<name>')] Bracket-notated child or children
    [<number> (, <number>)] Array index or indexes
    [start:end] Array slice operator
    [?(<expression>)] Filter expression. Expression must evaluate to a boolean value.

    2. js 类库

          jsonpath-plus  

          npm    

          

    npm install jsonpath-plus
    

       使用 nodeJs  broswer

       

     var JSONPath = require('jsonpath-plus');
      var result = JSONPath({json: obj, path: path});
    

      

    <script src="lib/jsonpath.js"></script> 
      <script>
          var result = JSONPath({path: path, json: obj});
      </script> 
    

      

      

        

  • 相关阅读:
    困难的图论
    [Poi2011]Meteors
    四维偏序
    bzoj2738矩阵乘法
    创建线程的三种方式
    java邮件发送
    Nginx配置文件分析
    如何理解java反射?
    正则表达式
    jenkins新手入门教程
  • 原文地址:https://www.cnblogs.com/rongfengliang/p/5938491.html
Copyright © 2020-2023  润新知