{
"automobiles": [
{ "maker": "Nissan", "model": "Teana", "year": 2011 },
{ "maker": "Honda", "model": "Jazz", "year": 2010 },
{ "maker": "Honda", "model": "Civic", "year": 2007 },
{ "maker": "Toyota", "model": "Yaris", "year": 2008 },
{ "maker": "Honda", "model": "Accord", "year": 2011 }
],
"motorcycles": [{ "maker": "Honda", "model": "ST1300", "year": 2012 }]
}
.automobiles{.maker === "Honda" && .year > 2009}.model["Jazz", "Accord"]
{ and }).1.23)"John Gold")true and false)null (null).nestedProp.deeplyNestedProp).prop{.nestedProp{.deeplyNestedProp{.stillMore || .yetAnother} || .otherDeeplyNested}})==true if both operands are equal.books{.id == "1"}===true if both operands are strictly equal without type conversion.books{.id === 1}!=true if operands are not equal.books{.id != "1"}!==true if operands are not equal and/or not of the same data type.books{.id !== 1}>true if left operand is greater than right.books{.id > 1}>=true if left operand is greater than or equal to right.books{.id >= 1}<true if left operand is less than right.books{.id < 1}<=true if left operand is less than or equal to right.books{.id <= 1}==true if both strings are equal.books{.title == "clean code"}^==true if left operand starts with right.books{.title ^== "Javascript"}^=true if left operand starts with right.books{.title ^= "javascript"}==^true if right operand starts with left.books{.title ==^ "Javascript"}=^true if right operand starts with left.books{.title =^ "javascript"}$==true if left operand ends with right.books{.title $== "Javascript"}$=true if left operand ends with right.books{.title $= "javascript"}==$true if right operand ends with left.books{.title ==$ "Javascript"}=$true if right operand ends with left.books{.title =$ "javascript"}*==true if left operand contains right.books{.title *== "Javascript"}*=true if left operand contains right.books{.title *= "javascript"}==*true if right operand contains left.books{.title ==* "Javascript"}=*true if right operand contains left.books{.title =* "javascript"}&&true if both operands are true.books{.price > 19 && .author.name === "Robert C. Martin"}||true if one or both operands are true.books{.title === "Maintainable JavaScript" || .title === "Clean Code"}!true if operand is false.books{!.title}0, the result will be true, otherwise false!!)+-*/%!, unary -*, /, %+, binary -<, <=, >, >===, ===, !=, !==, ^=, ^==, $==, $=, *=, *==, =^, ==^, =$, ==$, =*, ==*&&||( and )) are used to explicitly denote precedence by grouping parts of an expression that should be evaluated first.// find all book titles where the author is Robert C. Martin
'.books{.author.name === "Robert C. Martin"}.title';
/* ['Clean Code', 'Agile Software Development'] */
// find all book titles with price less than 17
".books{.price < 17}.title";
/* ['Maintainable JavaScript', 'JavaScript: The Good Parts'] */
[ and ]).[index]index – the first element has index 0, positional predicates are zero-based[3] returns the fourth element in the context[start:]start[2:] returns elements whose index is greater than or equal to 2[:end]end[:5] returns elements with indices from 0 to 4[start:end]start and less than end[2:5] returns elements with indices 2, 3, and 4index, start, or end can be negative numbers, which means that JSPATH counts from the end rather than the beginning:[-1][-3:].books[0].title.books.title[0].books[-1].title.books[:2].title.books[-2:].title.books[1:3].title.books{.price < 15}{.price > 5}[0].title.books{.price < 20 && (.author.name *== "Zakas" || .author.name *== "Martin")}.title.books{.price < 20 && .author{.name *== "Zakas" || .name *== "Martin"}}.title