title: How to use @odata.count property in JSONPath expression?
body: <p>Using the following JSON object from a response of a OData v4 API:</p>
  
  <pre><code>{
  
     "@odata.context": "https://api.asdfasdf.com/",
     "@odata.count": 2,
     "value": [
          {
              "id": 123456789,
              "name": "Random name"
          },
          {
              "id": 15345,
              "name": "Random name2"
          }
      ]
  }
  </code></pre>
  
  <p>This works to select the object in the array:
  <code>$.value[?(@.id == 123456789)]</code></p>
  
  <p>With this JSONPath I can get the value of the property "@odata.count":
  <code>$.['@odata.count']</code></p>
  
  <p>But how to write JSONPath with expressions using the "@odata.count"?
  For example. selecting only if the count is greater than 1, these expressions fail:</p>
  
  <pre><code>$.[('@odata.count' &gt; 1)]
  $.[?('@odata.count' &gt; 1)]
  $.[(@.['@odata.count'] &gt; 1)]
  ... and a lot of other expressions
  </code></pre>
  
  <p>I strongly believe I'm working on a different depth of the json than I think,
  and the naming convention of the property (and manner of selecting it) drives me nuts.</p>
  
  <p>The ultimate goal is to use the expression in a SoapUI Testsuite assertion.</p>
  
  <p>Comparing the "@odata.count" propery in the response against our test data.</p>
  
  <p><strong>Edit:</strong>
  Fixed json by removing quotes after the number, thanks to commenter.</p>
  
  <p>And additional findings of expressions that helped me finding the solution:</p>
  
  <p>These expressions results in '2':</p>
  
  <pre><code>$['@odata.count']
  $..[0]['@odata.count']
  </code></pre>
  
  <p>This expression results in an empty array:</p>
  
  <pre><code>$..[?(@['@odata.count'] &gt; 1)]
  </code></pre>
  
  <p>This expressions results in the value 'null':</p>
  
  <pre><code>?($['@odata.count'] &gt; 1)
  </code></pre>
  
  <p><strong>Edit 2:</strong>
  This question should have been asked slightly more general I think, it's more about "how to use root properties/root attributes/direct children of the response in JSONPath".
  A similar question I found, with a total different answer: <a href="https://stackoverflow.com/questions/36843690/querying-direct-children-of-root-element-with-jsonpath/36854660">Querying direct children of root element with jsonpath</a></p>