title: Exclude fields from JSON using JSONPath
body: <p>I am getting a JSON response from REST service call and want to select only some of the fields from response. I am using JSONPath to filter out the fields. Below is the JSON example:</p>
  
  <pre><code>{
      "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
          }
      }
  }
  </code></pre>
  
  <p>E.g. I want to select author and title from the response where category is 'reference'. I am using the below JSONPath</p>
  
  <pre><code>$.store.book[?(@.category='reference')]
  </code></pre>
  
  <p>This gives me below response:</p>
  
  <pre><code>{
      "category": "reference",
      "author": "Nigel Rees",
      "title": "Sayings of the Century",
      "price": 8.95
  }
  </code></pre>
  
  <p>However, I don't want all the fields. I only want author and title. If I try <code>$.store.book[?(@.category='reference')]['author']</code>, it gives me author name but if I try <code>$.store.book[?(@.category='reference')]['author', 'title']</code>, it doesn't return anything.</p>
  
  <p>Is there any provision in JSONPath to select (or exclude) fields with or without condition?</p>
  
  <p>I am using <a href="http://jsonpath.curiousconcept.com/" rel="noreferrer">http://jsonpath.curiousconcept.com/</a> to test JSONPath.</p>
  
  <p>Thanks in advance.</p>