{
"color": "red",
"count": 2
}JSONPath tester evaluates one expression against the document and returns the matches as a JSON array. The path has to start with $. $ alone is the whole document, returned as a one-element array, which is what you get on {"color":"red","count":2} with the box left at its default. A dotted key such as $.count returns that value, still wrapped in an array.
$.items[*].name walks every element of items and collects name. On a document whose items are Notebook with qty 12 and Pen with qty 4, that expression returns ["Notebook", "Pen"]. A filter [?(@.qty>10)] keeps elements whose qty compares with the number you wrote, so $.items[?(@.qty>10)].name returns ["Notebook"]. Comparisons are ==, !=, >, <, >=, and <=. A path that does not start with $, or a construct the page does not implement, stops with a message that names the position.
Document: {"items":[{"name":"Notebook","qty":12},{"name":"Pen","qty":4}]}. JSONPath: $.items[*].name. The default path $ on {"color":"red","count":2} is the sample capture.
$.items[*].name returns [ "Notebook", "Pen" ]. $.items[?(@.qty>10)].name returns ["Notebook"]. The default $ on the color object returns [ { "color": "red", "count": 2 } ]. $.count on that object returns [2].
The expression returns the values, as JSON, so $.items[*].name is something you can copy instead of folding the tree by hand.
Every name under items. For Notebook qty 12 and Pen qty 4 the array is ["Notebook", "Pen"], in document order.
The result is always the list of matches. $ matches the document once, so {"color":"red","count":2} comes back as a one-element array holding that object.
[?(@.qty>10)] and the other comparisons ==, !=, >=, <=, and <. The right-hand side can be a string, a number, true, false, or null. $.items[?(@.qty>10)].name keeps Notebook.
Paths have to start with $. items[*].name fails with JSONPath must start with $. A syntax the page does not implement fails with Unsupported JSONPath and a character position.
A key that is absent produces no match for that node. The result is an empty array when nothing matched, which is different from a syntax error.