Uploaded image for project: 'ZABBIX FEATURE REQUESTS'
  1. ZABBIX FEATURE REQUESTS
  2. ZBXNEXT-5460

Mutiple field selection with field names in JSONPath

    XMLWordPrintable

    Details

      Description

      Source JSON:

      {
         "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
            }
         },
         "expensive" : 10
      }
      

      JSONPath query:

      $.store.book[*]['author','title']
      

      Expectation:

      [
         {
            "author" : "Nigel Rees",
            "title" : "Sayings of the Century"
         },
         {
            "author" : "Evelyn Waugh",
            "title" : "Sword of Honour"
         },
         {
            "author" : "Herman Melville",
            "title" : "Moby Dick"
         },
         {
            "author" : "J. R. R. Tolkien",
            "title" : "The Lord of the Rings"
         }
      ]

      Result:

      ["Nigel Rees","Sayings of the Century","Evelyn Waugh","Sword of Honour","Herman Melville","Moby Dick","J. R. R. Tolkien","The Lord of the Rings"]
      

        Attachments

          Activity

            People

            Assignee:
            wiper Andris Zeila
            Reporter:
            alex_spq Alex Alexandrov
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated: