[{"data":1,"prerenderedAt":1758},["ShallowReactive",2],{"guide-json-path-syntax":3},{"id":4,"title":5,"body":6,"date":1750,"description":1751,"extension":1752,"meta":1753,"navigation":187,"path":1754,"readingTime":1341,"seo":1755,"stem":1756,"__hash__":1757},"guides\u002Fguides\u002Fjson-path-syntax.md","JSON Path Syntax: Complete Guide with Examples",{"type":7,"value":8,"toc":1715},"minimark",[9,14,18,21,25,34,40,162,212,219,225,265,272,275,311,315,318,325,344,350,417,421,425,457,461,468,537,542,596,604,607,611,662,666,736,740,888,892,930,937,940,969,975,979,1124,1128,1133,1153,1158,1169,1173,1177,1344,1407,1411,1486,1536,1540,1581,1585,1588,1617,1635,1698,1702,1711],[10,11,13],"h2",{"id":12},"what-is-json-path","What is JSON Path?",[15,16,17],"p",{},"JSON Path is a query language for JSON, similar to how XPath is used for XML. It allows you to extract specific data from JSON documents using a concise, expressive syntax. Whether you're working with APIs, configuration files, or complex data structures, JSON Path helps you navigate and filter JSON data efficiently.",[15,19,20],{},"Originally proposed by Stefan Goessner in 2007, JSON Path has become a standard tool in many programming ecosystems. Libraries exist for JavaScript, Python, Java, PHP, and many other languages.",[10,22,24],{"id":23},"basic-syntax-and-operators","Basic Syntax and Operators",[26,27,29,30],"h3",{"id":28},"the-root-element","The Root Element: ",[31,32,33],"code",{},"$",[15,35,36,37,39],{},"Every JSON Path expression starts with ",[31,38,33],{},", which represents the root of the JSON document.",[41,42,47],"pre",{"className":43,"code":44,"language":45,"meta":46,"style":46},"language-json shiki shiki-themes github-light github-dark","{\n  \"store\": {\n    \"name\": \"Book Store\",\n    \"books\": [\n      {\"title\": \"Book A\", \"price\": 10},\n      {\"title\": \"Book B\", \"price\": 20}\n    ]\n  }\n}\n","json","",[31,48,49,58,68,84,93,121,145,151,157],{"__ignoreMap":46},[50,51,54],"span",{"class":52,"line":53},"line",1,[50,55,57],{"class":56},"sVt8B","{\n",[50,59,61,65],{"class":52,"line":60},2,[50,62,64],{"class":63},"sj4cs","  \"store\"",[50,66,67],{"class":56},": {\n",[50,69,71,74,77,81],{"class":52,"line":70},3,[50,72,73],{"class":63},"    \"name\"",[50,75,76],{"class":56},": ",[50,78,80],{"class":79},"sZZnC","\"Book Store\"",[50,82,83],{"class":56},",\n",[50,85,87,90],{"class":52,"line":86},4,[50,88,89],{"class":63},"    \"books\"",[50,91,92],{"class":56},": [\n",[50,94,96,99,102,104,107,110,113,115,118],{"class":52,"line":95},5,[50,97,98],{"class":56},"      {",[50,100,101],{"class":63},"\"title\"",[50,103,76],{"class":56},[50,105,106],{"class":79},"\"Book A\"",[50,108,109],{"class":56},", ",[50,111,112],{"class":63},"\"price\"",[50,114,76],{"class":56},[50,116,117],{"class":63},"10",[50,119,120],{"class":56},"},\n",[50,122,124,126,128,130,133,135,137,139,142],{"class":52,"line":123},6,[50,125,98],{"class":56},[50,127,101],{"class":63},[50,129,76],{"class":56},[50,131,132],{"class":79},"\"Book B\"",[50,134,109],{"class":56},[50,136,112],{"class":63},[50,138,76],{"class":56},[50,140,141],{"class":63},"20",[50,143,144],{"class":56},"}\n",[50,146,148],{"class":52,"line":147},7,[50,149,150],{"class":56},"    ]\n",[50,152,154],{"class":52,"line":153},8,[50,155,156],{"class":56},"  }\n",[50,158,160],{"class":52,"line":159},9,[50,161,144],{"class":56},[41,163,167],{"className":164,"code":165,"language":166,"meta":46,"style":46},"language-javascript shiki shiki-themes github-light github-dark","\u002F\u002F JSON Path expression\n$.store.name  \u002F\u002F Returns: \"Book Store\"\n\n\u002F\u002F JavaScript equivalent using lodash\n_.get(data, 'store.name');\n","javascript",[31,168,169,175,183,189,194],{"__ignoreMap":46},[50,170,171],{"class":52,"line":53},[50,172,174],{"class":173},"sJ8bj","\u002F\u002F JSON Path expression\n",[50,176,177,180],{"class":52,"line":60},[50,178,179],{"class":56},"$.store.name  ",[50,181,182],{"class":173},"\u002F\u002F Returns: \"Book Store\"\n",[50,184,185],{"class":52,"line":70},[50,186,188],{"emptyLinePlaceholder":187},true,"\n",[50,190,191],{"class":52,"line":86},[50,192,193],{"class":173},"\u002F\u002F JavaScript equivalent using lodash\n",[50,195,196,199,203,206,209],{"class":52,"line":95},[50,197,198],{"class":56},"_.",[50,200,202],{"class":201},"sScJk","get",[50,204,205],{"class":56},"(data, ",[50,207,208],{"class":79},"'store.name'",[50,210,211],{"class":56},");\n",[26,213,215,216],{"id":214},"current-node","Current Node: ",[31,217,218],{},"@",[15,220,221,222,224],{},"The ",[31,223,218],{}," symbol refers to the current node being processed, especially useful inside filters.",[41,226,228],{"className":164,"code":227,"language":166,"meta":46,"style":46},"\u002F\u002F Find books with price greater than 15\n$.store.books[?(@.price > 15)]\n\n\u002F\u002F The @ refers to each book object during iteration\n",[31,229,230,235,256,260],{"__ignoreMap":46},[50,231,232],{"class":52,"line":53},[50,233,234],{"class":173},"\u002F\u002F Find books with price greater than 15\n",[50,236,237,240,244,247,250,253],{"class":52,"line":60},[50,238,239],{"class":56},"$.store.books[",[50,241,243],{"class":242},"szBVR","?",[50,245,246],{"class":56},"(@.price ",[50,248,249],{"class":242},">",[50,251,252],{"class":63}," 15",[50,254,255],{"class":56},")]\n",[50,257,258],{"class":52,"line":70},[50,259,188],{"emptyLinePlaceholder":187},[50,261,262],{"class":52,"line":86},[50,263,264],{"class":173},"\u002F\u002F The @ refers to each book object during iteration\n",[26,266,268,269],{"id":267},"wildcard","Wildcard: ",[31,270,271],{},"*",[15,273,274],{},"The asterisk matches all elements at the current level.",[41,276,278],{"className":164,"code":277,"language":166,"meta":46,"style":46},"\u002F\u002F Get all properties of the store object\n$.store.*\n\n\u002F\u002F Get all book titles\n$.store.books[*].title\n",[31,279,280,285,293,297,302],{"__ignoreMap":46},[50,281,282],{"class":52,"line":53},[50,283,284],{"class":173},"\u002F\u002F Get all properties of the store object\n",[50,286,287,290],{"class":52,"line":60},[50,288,289],{"class":56},"$.store.",[50,291,292],{"class":242},"*\n",[50,294,295],{"class":52,"line":70},[50,296,188],{"emptyLinePlaceholder":187},[50,298,299],{"class":52,"line":86},[50,300,301],{"class":173},"\u002F\u002F Get all book titles\n",[50,303,304,306,308],{"class":52,"line":95},[50,305,239],{"class":56},[50,307,271],{"class":242},[50,309,310],{"class":56},"].title\n",[10,312,314],{"id":313},"dot-notation-vs-bracket-notation","Dot Notation vs Bracket Notation",[15,316,317],{},"JSON Path supports two styles for accessing properties:",[15,319,320,324],{},[321,322,323],"strong",{},"Dot Notation"," (cleaner, preferred when keys are simple):",[41,326,328],{"className":164,"code":327,"language":166,"meta":46,"style":46},"$.store.name\n$.store.books[0].title\n",[31,329,330,335],{"__ignoreMap":46},[50,331,332],{"class":52,"line":53},[50,333,334],{"class":56},"$.store.name\n",[50,336,337,339,342],{"class":52,"line":60},[50,338,239],{"class":56},[50,340,341],{"class":63},"0",[50,343,310],{"class":56},[15,345,346,349],{},[321,347,348],{},"Bracket Notation"," (required for special characters or dynamic keys):",[41,351,353],{"className":164,"code":352,"language":166,"meta":46,"style":46},"$['store']['name']\n$['store']['books'][0]['title']\n\n\u002F\u002F Useful when key contains spaces or special characters\n$['user settings']['theme color']\n",[31,354,355,372,394,398,403],{"__ignoreMap":46},[50,356,357,360,363,366,369],{"class":52,"line":53},[50,358,359],{"class":56},"$[",[50,361,362],{"class":79},"'store'",[50,364,365],{"class":56},"][",[50,367,368],{"class":79},"'name'",[50,370,371],{"class":56},"]\n",[50,373,374,376,378,380,383,385,387,389,392],{"class":52,"line":60},[50,375,359],{"class":56},[50,377,362],{"class":79},[50,379,365],{"class":56},[50,381,382],{"class":79},"'books'",[50,384,365],{"class":56},[50,386,341],{"class":63},[50,388,365],{"class":56},[50,390,391],{"class":79},"'title'",[50,393,371],{"class":56},[50,395,396],{"class":52,"line":70},[50,397,188],{"emptyLinePlaceholder":187},[50,399,400],{"class":52,"line":86},[50,401,402],{"class":173},"\u002F\u002F Useful when key contains spaces or special characters\n",[50,404,405,407,410,412,415],{"class":52,"line":95},[50,406,359],{"class":56},[50,408,409],{"class":79},"'user settings'",[50,411,365],{"class":56},[50,413,414],{"class":79},"'theme color'",[50,416,371],{"class":56},[10,418,420],{"id":419},"array-access-and-slicing","Array Access and Slicing",[26,422,424],{"id":423},"index-access","Index Access",[41,426,428],{"className":164,"code":427,"language":166,"meta":46,"style":46},"\u002F\u002F First book\n$.store.books[0]\n\n\u002F\u002F Last book (using -1 is not standard, but some implementations support it)\n\u002F\u002F Standard approach: use length - 1 in your code\n",[31,429,430,435,443,447,452],{"__ignoreMap":46},[50,431,432],{"class":52,"line":53},[50,433,434],{"class":173},"\u002F\u002F First book\n",[50,436,437,439,441],{"class":52,"line":60},[50,438,239],{"class":56},[50,440,341],{"class":63},[50,442,371],{"class":56},[50,444,445],{"class":52,"line":70},[50,446,188],{"emptyLinePlaceholder":187},[50,448,449],{"class":52,"line":86},[50,450,451],{"class":173},"\u002F\u002F Last book (using -1 is not standard, but some implementations support it)\n",[50,453,454],{"class":52,"line":95},[50,455,456],{"class":173},"\u002F\u002F Standard approach: use length - 1 in your code\n",[26,458,460],{"id":459},"array-slices","Array Slices",[15,462,463,464,467],{},"The slice syntax ",[31,465,466],{},"[start:end:step]"," allows you to extract ranges from arrays.",[41,469,471],{"className":164,"code":470,"language":166,"meta":46,"style":46},"\u002F\u002F First two books\n$.store.books[0:2]\n\n\u002F\u002F Every other book starting from index 0\n$.store.books[0:4:2]\n\n\u002F\u002F From index 1 to end\n$.store.books[1:]\n",[31,472,473,478,492,496,501,518,522,527],{"__ignoreMap":46},[50,474,475],{"class":52,"line":53},[50,476,477],{"class":173},"\u002F\u002F First two books\n",[50,479,480,482,484,487,490],{"class":52,"line":60},[50,481,239],{"class":56},[50,483,341],{"class":63},[50,485,486],{"class":56},":",[50,488,489],{"class":63},"2",[50,491,371],{"class":56},[50,493,494],{"class":52,"line":70},[50,495,188],{"emptyLinePlaceholder":187},[50,497,498],{"class":52,"line":86},[50,499,500],{"class":173},"\u002F\u002F Every other book starting from index 0\n",[50,502,503,505,507,509,512,514,516],{"class":52,"line":95},[50,504,239],{"class":56},[50,506,341],{"class":63},[50,508,486],{"class":56},[50,510,511],{"class":63},"4",[50,513,486],{"class":56},[50,515,489],{"class":63},[50,517,371],{"class":56},[50,519,520],{"class":52,"line":123},[50,521,188],{"emptyLinePlaceholder":187},[50,523,524],{"class":52,"line":147},[50,525,526],{"class":173},"\u002F\u002F From index 1 to end\n",[50,528,529,531,534],{"class":52,"line":153},[50,530,239],{"class":56},[50,532,533],{"class":63},"1",[50,535,536],{"class":56},":]\n",[15,538,539],{},[321,540,541],{},"Slice Parameters:",[543,544,545,561],"table",{},[546,547,548],"thead",{},[549,550,551,555,558],"tr",{},[552,553,554],"th",{},"Parameter",[552,556,557],{},"Description",[552,559,560],{},"Default",[562,563,564,575,586],"tbody",{},[549,565,566,570,573],{},[567,568,569],"td",{},"start",[567,571,572],{},"Starting index (inclusive)",[567,574,341],{},[549,576,577,580,583],{},[567,578,579],{},"end",[567,581,582],{},"Ending index (exclusive)",[567,584,585],{},"Array length",[549,587,588,591,594],{},[567,589,590],{},"step",[567,592,593],{},"Step size",[567,595,533],{},[10,597,599,600,603],{"id":598},"filters-the-powerful-syntax","Filters: The Powerful ",[31,601,602],{},"?()"," Syntax",[15,605,606],{},"Filters allow you to select items based on conditions. This is where JSON Path becomes truly powerful.",[26,608,610],{"id":609},"basic-comparisons","Basic Comparisons",[41,612,614],{"className":164,"code":613,"language":166,"meta":46,"style":46},"\u002F\u002F Books cheaper than 15\n$.store.books[?(@.price \u003C 15)]\n\n\u002F\u002F Books with a specific title\n$.store.books[?(@.title == 'Book A')]\n",[31,615,616,621,636,640,645],{"__ignoreMap":46},[50,617,618],{"class":52,"line":53},[50,619,620],{"class":173},"\u002F\u002F Books cheaper than 15\n",[50,622,623,625,627,629,632,634],{"class":52,"line":60},[50,624,239],{"class":56},[50,626,243],{"class":242},[50,628,246],{"class":56},[50,630,631],{"class":242},"\u003C",[50,633,252],{"class":63},[50,635,255],{"class":56},[50,637,638],{"class":52,"line":70},[50,639,188],{"emptyLinePlaceholder":187},[50,641,642],{"class":52,"line":86},[50,643,644],{"class":173},"\u002F\u002F Books with a specific title\n",[50,646,647,649,651,654,657,660],{"class":52,"line":95},[50,648,239],{"class":56},[50,650,243],{"class":242},[50,652,653],{"class":56},"(@.title ",[50,655,656],{"class":242},"==",[50,658,659],{"class":79}," 'Book A'",[50,661,255],{"class":56},[26,663,665],{"id":664},"logical-operators","Logical Operators",[41,667,669],{"className":164,"code":668,"language":166,"meta":46,"style":46},"\u002F\u002F Books that are cheap AND fiction\n$.store.books[?(@.price \u003C 15 && @.category == 'fiction')]\n\n\u002F\u002F Books that are either cheap OR on sale\n$.store.books[?(@.price \u003C 10 || @.onsale == true)]\n",[31,670,671,676,701,705,710],{"__ignoreMap":46},[50,672,673],{"class":52,"line":53},[50,674,675],{"class":173},"\u002F\u002F Books that are cheap AND fiction\n",[50,677,678,680,682,684,686,688,691,694,696,699],{"class":52,"line":60},[50,679,239],{"class":56},[50,681,243],{"class":242},[50,683,246],{"class":56},[50,685,631],{"class":242},[50,687,252],{"class":63},[50,689,690],{"class":242}," &&",[50,692,693],{"class":56}," @.category ",[50,695,656],{"class":242},[50,697,698],{"class":79}," 'fiction'",[50,700,255],{"class":56},[50,702,703],{"class":52,"line":70},[50,704,188],{"emptyLinePlaceholder":187},[50,706,707],{"class":52,"line":86},[50,708,709],{"class":173},"\u002F\u002F Books that are either cheap OR on sale\n",[50,711,712,714,716,718,720,723,726,729,731,734],{"class":52,"line":95},[50,713,239],{"class":56},[50,715,243],{"class":242},[50,717,246],{"class":56},[50,719,631],{"class":242},[50,721,722],{"class":63}," 10",[50,724,725],{"class":242}," ||",[50,727,728],{"class":56}," @.onsale ",[50,730,656],{"class":242},[50,732,733],{"class":63}," true",[50,735,255],{"class":56},[26,737,739],{"id":738},"supported-operators","Supported Operators",[543,741,742,754],{},[546,743,744],{},[549,745,746,749,751],{},[552,747,748],{},"Operator",[552,750,557],{},[552,752,753],{},"Example",[562,755,756,770,785,799,814,828,843,858,873],{},[549,757,758,762,765],{},[567,759,760],{},[31,761,656],{},[567,763,764],{},"Equal",[567,766,767],{},[31,768,769],{},"?(@.price == 10)",[549,771,772,777,780],{},[567,773,774],{},[31,775,776],{},"!=",[567,778,779],{},"Not equal",[567,781,782],{},[31,783,784],{},"?(@.type != 'ebook')",[549,786,787,791,794],{},[567,788,789],{},[31,790,631],{},[567,792,793],{},"Less than",[567,795,796],{},[31,797,798],{},"?(@.price \u003C 20)",[549,800,801,806,809],{},[567,802,803],{},[31,804,805],{},"\u003C=",[567,807,808],{},"Less or equal",[567,810,811],{},[31,812,813],{},"?(@.rating \u003C= 4.5)",[549,815,816,820,823],{},[567,817,818],{},[31,819,249],{},[567,821,822],{},"Greater than",[567,824,825],{},[31,826,827],{},"?(@.price > 10)",[549,829,830,835,838],{},[567,831,832],{},[31,833,834],{},">=",[567,836,837],{},"Greater or equal",[567,839,840],{},[31,841,842],{},"?(@.pages >= 300)",[549,844,845,850,853],{},[567,846,847],{},[31,848,849],{},"=~",[567,851,852],{},"Regex match",[567,854,855],{},[31,856,857],{},"?(@.title =~ \u002Fbook\u002Fi)",[549,859,860,865,868],{},[567,861,862],{},[31,863,864],{},"in",[567,866,867],{},"In array",[567,869,870],{},[31,871,872],{},"?(@.category in ['fiction','drama'])",[549,874,875,880,883],{},[567,876,877],{},[31,878,879],{},"nin",[567,881,882],{},"Not in array",[567,884,885],{},[31,886,887],{},"?(@.status nin ['outdated','deleted'])",[26,889,891],{"id":890},"existential-checks","Existential Checks",[41,893,895],{"className":164,"code":894,"language":166,"meta":46,"style":46},"\u002F\u002F Books that have an 'isbn' field\n$.store.books[?(@.isbn)]\n\n\u002F\u002F Books that DON'T have a 'discount' field\n$.store.books[?!@.discount]\n",[31,896,897,902,911,915,920],{"__ignoreMap":46},[50,898,899],{"class":52,"line":53},[50,900,901],{"class":173},"\u002F\u002F Books that have an 'isbn' field\n",[50,903,904,906,908],{"class":52,"line":60},[50,905,239],{"class":56},[50,907,243],{"class":242},[50,909,910],{"class":56},"(@.isbn)]\n",[50,912,913],{"class":52,"line":70},[50,914,188],{"emptyLinePlaceholder":187},[50,916,917],{"class":52,"line":86},[50,918,919],{"class":173},"\u002F\u002F Books that DON'T have a 'discount' field\n",[50,921,922,924,927],{"class":52,"line":95},[50,923,239],{"class":56},[50,925,926],{"class":242},"?!",[50,928,929],{"class":56},"@.discount]\n",[10,931,933,934],{"id":932},"recursive-descent","Recursive Descent: ",[31,935,936],{},"..",[15,938,939],{},"The double dot operator searches for matching nodes at any depth in the tree.",[41,941,943],{"className":164,"code":942,"language":166,"meta":46,"style":46},"\u002F\u002F Find all price values anywhere in the document\n$.store..price\n\n\u002F\u002F Find all objects that have a 'title' field\n$..title\n",[31,944,945,950,955,959,964],{"__ignoreMap":46},[50,946,947],{"class":52,"line":53},[50,948,949],{"class":173},"\u002F\u002F Find all price values anywhere in the document\n",[50,951,952],{"class":52,"line":60},[50,953,954],{"class":56},"$.store..price\n",[50,956,957],{"class":52,"line":70},[50,958,188],{"emptyLinePlaceholder":187},[50,960,961],{"class":52,"line":86},[50,962,963],{"class":173},"\u002F\u002F Find all objects that have a 'title' field\n",[50,965,966],{"class":52,"line":95},[50,967,968],{"class":56},"$..title\n",[15,970,971,974],{},[321,972,973],{},"Warning:"," Recursive descent can be expensive on large documents. Use it judiciously.",[10,976,978],{"id":977},"json-path-vs-xpath-a-comparison","JSON Path vs XPath: A Comparison",[543,980,981,994],{},[546,982,983],{},[549,984,985,988,991],{},[552,986,987],{},"Feature",[552,989,990],{},"JSON Path",[552,992,993],{},"XPath",[562,995,996,1009,1025,1041,1056,1073,1089,1107],{},[549,997,998,1003,1006],{},[567,999,1000],{},[321,1001,1002],{},"Data Format",[567,1004,1005],{},"JSON",[567,1007,1008],{},"XML",[549,1010,1011,1016,1020],{},[567,1012,1013],{},[321,1014,1015],{},"Root",[567,1017,1018],{},[31,1019,33],{},[567,1021,1022],{},[31,1023,1024],{},"\u002F",[549,1026,1027,1032,1036],{},[567,1028,1029],{},[321,1030,1031],{},"Current Node",[567,1033,1034],{},[31,1035,218],{},[567,1037,1038],{},[31,1039,1040],{},".",[549,1042,1043,1048,1052],{},[567,1044,1045],{},[321,1046,1047],{},"Wildcard",[567,1049,1050],{},[31,1051,271],{},[567,1053,1054],{},[31,1055,271],{},[549,1057,1058,1063,1067],{},[567,1059,1060],{},[321,1061,1062],{},"Filter",[567,1064,1065],{},[31,1066,602],{},[567,1068,1069,1072],{},[31,1070,1071],{},"[]"," with predicates",[549,1074,1075,1080,1084],{},[567,1076,1077],{},[321,1078,1079],{},"Recursive",[567,1081,1082],{},[31,1083,936],{},[567,1085,1086],{},[31,1087,1088],{},"\u002F\u002F",[549,1090,1091,1096,1101],{},[567,1092,1093],{},[321,1094,1095],{},"Array Index",[567,1097,1098],{},[31,1099,1100],{},"[0]",[567,1102,1103,1106],{},[31,1104,1105],{},"[1]"," (XPath is 1-indexed)",[549,1108,1109,1114,1119],{},[567,1110,1111],{},[321,1112,1113],{},"Attribute Access",[567,1115,1116],{},[31,1117,1118],{},".name",[567,1120,1121],{},[31,1122,1123],{},"@name",[26,1125,1127],{"id":1126},"example-comparison","Example Comparison",[15,1129,1130],{},[321,1131,1132],{},"JSON Path:",[41,1134,1136],{"className":164,"code":1135,"language":166,"meta":46,"style":46},"$.store.books[?(@.price \u003C 15)].title\n",[31,1137,1138],{"__ignoreMap":46},[50,1139,1140,1142,1144,1146,1148,1150],{"class":52,"line":53},[50,1141,239],{"class":56},[50,1143,243],{"class":242},[50,1145,246],{"class":56},[50,1147,631],{"class":242},[50,1149,252],{"class":63},[50,1151,1152],{"class":56},")].title\n",[15,1154,1155],{},[321,1156,1157],{},"XPath equivalent:",[41,1159,1163],{"className":1160,"code":1161,"language":1162,"meta":46,"style":46},"language-xpath shiki shiki-themes github-light github-dark","\u002Fstore\u002Fbooks[price \u003C 15]\u002Ftitle\n","xpath",[31,1164,1165],{"__ignoreMap":46},[50,1166,1167],{"class":52,"line":53},[50,1168,1161],{},[10,1170,1172],{"id":1171},"practical-examples","Practical Examples",[26,1174,1176],{"id":1175},"example-1-api-response-parsing","Example 1: API Response Parsing",[41,1178,1180],{"className":43,"code":1179,"language":45,"meta":46,"style":46},"{\n  \"data\": {\n    \"users\": [\n      {\"id\": 1, \"name\": \"Alice\", \"active\": true, \"role\": \"admin\"},\n      {\"id\": 2, \"name\": \"Bob\", \"active\": false, \"role\": \"user\"},\n      {\"id\": 3, \"name\": \"Charlie\", \"active\": true, \"role\": \"user\"}\n    ],\n    \"total\": 3\n  }\n}\n",[31,1181,1182,1186,1193,1200,1243,1282,1320,1325,1335,1339],{"__ignoreMap":46},[50,1183,1184],{"class":52,"line":53},[50,1185,57],{"class":56},[50,1187,1188,1191],{"class":52,"line":60},[50,1189,1190],{"class":63},"  \"data\"",[50,1192,67],{"class":56},[50,1194,1195,1198],{"class":52,"line":70},[50,1196,1197],{"class":63},"    \"users\"",[50,1199,92],{"class":56},[50,1201,1202,1204,1207,1209,1211,1213,1216,1218,1221,1223,1226,1228,1231,1233,1236,1238,1241],{"class":52,"line":86},[50,1203,98],{"class":56},[50,1205,1206],{"class":63},"\"id\"",[50,1208,76],{"class":56},[50,1210,533],{"class":63},[50,1212,109],{"class":56},[50,1214,1215],{"class":63},"\"name\"",[50,1217,76],{"class":56},[50,1219,1220],{"class":79},"\"Alice\"",[50,1222,109],{"class":56},[50,1224,1225],{"class":63},"\"active\"",[50,1227,76],{"class":56},[50,1229,1230],{"class":63},"true",[50,1232,109],{"class":56},[50,1234,1235],{"class":63},"\"role\"",[50,1237,76],{"class":56},[50,1239,1240],{"class":79},"\"admin\"",[50,1242,120],{"class":56},[50,1244,1245,1247,1249,1251,1253,1255,1257,1259,1262,1264,1266,1268,1271,1273,1275,1277,1280],{"class":52,"line":95},[50,1246,98],{"class":56},[50,1248,1206],{"class":63},[50,1250,76],{"class":56},[50,1252,489],{"class":63},[50,1254,109],{"class":56},[50,1256,1215],{"class":63},[50,1258,76],{"class":56},[50,1260,1261],{"class":79},"\"Bob\"",[50,1263,109],{"class":56},[50,1265,1225],{"class":63},[50,1267,76],{"class":56},[50,1269,1270],{"class":63},"false",[50,1272,109],{"class":56},[50,1274,1235],{"class":63},[50,1276,76],{"class":56},[50,1278,1279],{"class":79},"\"user\"",[50,1281,120],{"class":56},[50,1283,1284,1286,1288,1290,1293,1295,1297,1299,1302,1304,1306,1308,1310,1312,1314,1316,1318],{"class":52,"line":123},[50,1285,98],{"class":56},[50,1287,1206],{"class":63},[50,1289,76],{"class":56},[50,1291,1292],{"class":63},"3",[50,1294,109],{"class":56},[50,1296,1215],{"class":63},[50,1298,76],{"class":56},[50,1300,1301],{"class":79},"\"Charlie\"",[50,1303,109],{"class":56},[50,1305,1225],{"class":63},[50,1307,76],{"class":56},[50,1309,1230],{"class":63},[50,1311,109],{"class":56},[50,1313,1235],{"class":63},[50,1315,76],{"class":56},[50,1317,1279],{"class":79},[50,1319,144],{"class":56},[50,1321,1322],{"class":52,"line":147},[50,1323,1324],{"class":56},"    ],\n",[50,1326,1327,1330,1332],{"class":52,"line":153},[50,1328,1329],{"class":63},"    \"total\"",[50,1331,76],{"class":56},[50,1333,1334],{"class":63},"3\n",[50,1336,1337],{"class":52,"line":159},[50,1338,156],{"class":56},[50,1340,1342],{"class":52,"line":1341},10,[50,1343,144],{"class":56},[41,1345,1347],{"className":164,"code":1346,"language":166,"meta":46,"style":46},"\u002F\u002F Get all active user names\n$.data.users[?(@.active == true)].name\n\u002F\u002F Result: [\"Alice\", \"Charlie\"]\n\n\u002F\u002F Get admin user IDs\n$.data.users[?(@.role == 'admin')].id\n\u002F\u002F Result: [1]\n",[31,1348,1349,1354,1371,1376,1380,1385,1402],{"__ignoreMap":46},[50,1350,1351],{"class":52,"line":53},[50,1352,1353],{"class":173},"\u002F\u002F Get all active user names\n",[50,1355,1356,1359,1361,1364,1366,1368],{"class":52,"line":60},[50,1357,1358],{"class":56},"$.data.users[",[50,1360,243],{"class":242},[50,1362,1363],{"class":56},"(@.active ",[50,1365,656],{"class":242},[50,1367,733],{"class":63},[50,1369,1370],{"class":56},")].name\n",[50,1372,1373],{"class":52,"line":70},[50,1374,1375],{"class":173},"\u002F\u002F Result: [\"Alice\", \"Charlie\"]\n",[50,1377,1378],{"class":52,"line":86},[50,1379,188],{"emptyLinePlaceholder":187},[50,1381,1382],{"class":52,"line":95},[50,1383,1384],{"class":173},"\u002F\u002F Get admin user IDs\n",[50,1386,1387,1389,1391,1394,1396,1399],{"class":52,"line":123},[50,1388,1358],{"class":56},[50,1390,243],{"class":242},[50,1392,1393],{"class":56},"(@.role ",[50,1395,656],{"class":242},[50,1397,1398],{"class":79}," 'admin'",[50,1400,1401],{"class":56},")].id\n",[50,1403,1404],{"class":52,"line":147},[50,1405,1406],{"class":173},"\u002F\u002F Result: [1]\n",[26,1408,1410],{"id":1409},"example-2-configuration-extraction","Example 2: Configuration Extraction",[41,1412,1414],{"className":43,"code":1413,"language":45,"meta":46,"style":46},"{\n  \"environments\": {\n    \"dev\": {\"api_url\": \"dev.api.com\", \"debug\": true},\n    \"prod\": {\"api_url\": \"api.com\", \"debug\": false}\n  }\n}\n",[31,1415,1416,1420,1427,1454,1478,1482],{"__ignoreMap":46},[50,1417,1418],{"class":52,"line":53},[50,1419,57],{"class":56},[50,1421,1422,1425],{"class":52,"line":60},[50,1423,1424],{"class":63},"  \"environments\"",[50,1426,67],{"class":56},[50,1428,1429,1432,1435,1438,1440,1443,1445,1448,1450,1452],{"class":52,"line":70},[50,1430,1431],{"class":63},"    \"dev\"",[50,1433,1434],{"class":56},": {",[50,1436,1437],{"class":63},"\"api_url\"",[50,1439,76],{"class":56},[50,1441,1442],{"class":79},"\"dev.api.com\"",[50,1444,109],{"class":56},[50,1446,1447],{"class":63},"\"debug\"",[50,1449,76],{"class":56},[50,1451,1230],{"class":63},[50,1453,120],{"class":56},[50,1455,1456,1459,1461,1463,1465,1468,1470,1472,1474,1476],{"class":52,"line":86},[50,1457,1458],{"class":63},"    \"prod\"",[50,1460,1434],{"class":56},[50,1462,1437],{"class":63},[50,1464,76],{"class":56},[50,1466,1467],{"class":79},"\"api.com\"",[50,1469,109],{"class":56},[50,1471,1447],{"class":63},[50,1473,76],{"class":56},[50,1475,1270],{"class":63},[50,1477,144],{"class":56},[50,1479,1480],{"class":52,"line":95},[50,1481,156],{"class":56},[50,1483,1484],{"class":52,"line":123},[50,1485,144],{"class":56},[41,1487,1489],{"className":164,"code":1488,"language":166,"meta":46,"style":46},"\u002F\u002F Get all API URLs\n$.environments.*.api_url\n\u002F\u002F Result: [\"dev.api.com\", \"api.com\"]\n\n\u002F\u002F Check if any environment has debug enabled\n$.environments[?(@.debug == true)]\n",[31,1490,1491,1496,1506,1511,1515,1520],{"__ignoreMap":46},[50,1492,1493],{"class":52,"line":53},[50,1494,1495],{"class":173},"\u002F\u002F Get all API URLs\n",[50,1497,1498,1501,1503],{"class":52,"line":60},[50,1499,1500],{"class":56},"$.environments.",[50,1502,271],{"class":242},[50,1504,1505],{"class":56},".api_url\n",[50,1507,1508],{"class":52,"line":70},[50,1509,1510],{"class":173},"\u002F\u002F Result: [\"dev.api.com\", \"api.com\"]\n",[50,1512,1513],{"class":52,"line":86},[50,1514,188],{"emptyLinePlaceholder":187},[50,1516,1517],{"class":52,"line":95},[50,1518,1519],{"class":173},"\u002F\u002F Check if any environment has debug enabled\n",[50,1521,1522,1525,1527,1530,1532,1534],{"class":52,"line":123},[50,1523,1524],{"class":56},"$.environments[",[50,1526,243],{"class":242},[50,1528,1529],{"class":56},"(@.debug ",[50,1531,656],{"class":242},[50,1533,733],{"class":63},[50,1535,255],{"class":56},[10,1537,1539],{"id":1538},"common-pitfalls-and-tips","Common Pitfalls and Tips",[1541,1542,1543,1550,1560,1566,1575],"ol",{},[1544,1545,1546,1549],"li",{},[321,1547,1548],{},"Indexing starts at 0"," (unlike XPath which starts at 1)",[1544,1551,1552,1555,1556,1559],{},[321,1553,1554],{},"String comparisons are case-sensitive"," unless you use regex with ",[31,1557,1558],{},"i"," flag",[1544,1561,1562,1565],{},[321,1563,1564],{},"Not all implementations support all features"," — check your library's documentation",[1544,1567,1568,1574],{},[321,1569,1570,1571,1573],{},"Use ",[31,1572,936],{}," sparingly"," on large documents as it traverses the entire tree",[1544,1576,1577,1580],{},[321,1578,1579],{},"Filters can only be used on arrays",", not objects",[10,1582,1584],{"id":1583},"testing-json-path-expressions","Testing JSON Path Expressions",[15,1586,1587],{},"You can test JSON Path expressions using:",[1589,1590,1591,1601,1607],"ul",{},[1544,1592,1593,1594],{},"Online evaluators like ",[1595,1596,1600],"a",{"href":1597,"rel":1598},"https:\u002F\u002Fjsonpath.com",[1599],"nofollow","jsonpath.com",[1544,1602,1603,1604],{},"Browser console with libraries like ",[31,1605,1606],{},"jsonpath-plus",[1544,1608,1609,1610,1613,1614,1616],{},"Node.js with ",[31,1611,1612],{},"jsonpath"," or ",[31,1615,1606],{}," packages",[41,1618,1622],{"className":1619,"code":1620,"language":1621,"meta":46,"style":46},"language-bash shiki shiki-themes github-light github-dark","npm install jsonpath-plus\n","bash",[31,1623,1624],{"__ignoreMap":46},[50,1625,1626,1629,1632],{"class":52,"line":53},[50,1627,1628],{"class":201},"npm",[50,1630,1631],{"class":79}," install",[50,1633,1634],{"class":79}," jsonpath-plus\n",[41,1636,1638],{"className":164,"code":1637,"language":166,"meta":46,"style":46},"import { JSONPath } from 'jsonpath-plus';\n\nconst result = JSONPath({ path: '$.store.books[*].title', json: data });\nconsole.log(result); \u002F\u002F ['Book A', 'Book B']\n",[31,1639,1640,1657,1661,1684],{"__ignoreMap":46},[50,1641,1642,1645,1648,1651,1654],{"class":52,"line":53},[50,1643,1644],{"class":242},"import",[50,1646,1647],{"class":56}," { JSONPath } ",[50,1649,1650],{"class":242},"from",[50,1652,1653],{"class":79}," 'jsonpath-plus'",[50,1655,1656],{"class":56},";\n",[50,1658,1659],{"class":52,"line":60},[50,1660,188],{"emptyLinePlaceholder":187},[50,1662,1663,1666,1669,1672,1675,1678,1681],{"class":52,"line":70},[50,1664,1665],{"class":242},"const",[50,1667,1668],{"class":63}," result",[50,1670,1671],{"class":242}," =",[50,1673,1674],{"class":201}," JSONPath",[50,1676,1677],{"class":56},"({ path: ",[50,1679,1680],{"class":79},"'$.store.books[*].title'",[50,1682,1683],{"class":56},", json: data });\n",[50,1685,1686,1689,1692,1695],{"class":52,"line":86},[50,1687,1688],{"class":56},"console.",[50,1690,1691],{"class":201},"log",[50,1693,1694],{"class":56},"(result); ",[50,1696,1697],{"class":173},"\u002F\u002F ['Book A', 'Book B']\n",[10,1699,1701],{"id":1700},"related-tools","Related Tools",[1589,1703,1704],{},[1544,1705,1706,1710],{},[1595,1707,1709],{"href":1708},"\u002Ftools\u002Fjson-formatter","JSON Formatter"," — Format and validate JSON data",[1712,1713,1714],"style",{},"html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sJ8bj, html code.shiki .sJ8bj{--shiki-default:#6A737D;--shiki-dark:#6A737D}html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .szBVR, html code.shiki .szBVR{--shiki-default:#D73A49;--shiki-dark:#F97583}",{"title":46,"searchDepth":60,"depth":60,"links":1716},[1717,1718,1726,1727,1731,1738,1740,1743,1747,1748,1749],{"id":12,"depth":60,"text":13},{"id":23,"depth":60,"text":24,"children":1719},[1720,1722,1724],{"id":28,"depth":70,"text":1721},"The Root Element: $",{"id":214,"depth":70,"text":1723},"Current Node: @",{"id":267,"depth":70,"text":1725},"Wildcard: *",{"id":313,"depth":60,"text":314},{"id":419,"depth":60,"text":420,"children":1728},[1729,1730],{"id":423,"depth":70,"text":424},{"id":459,"depth":70,"text":460},{"id":598,"depth":60,"text":1732,"children":1733},"Filters: The Powerful ?() Syntax",[1734,1735,1736,1737],{"id":609,"depth":70,"text":610},{"id":664,"depth":70,"text":665},{"id":738,"depth":70,"text":739},{"id":890,"depth":70,"text":891},{"id":932,"depth":60,"text":1739},"Recursive Descent: ..",{"id":977,"depth":60,"text":978,"children":1741},[1742],{"id":1126,"depth":70,"text":1127},{"id":1171,"depth":60,"text":1172,"children":1744},[1745,1746],{"id":1175,"depth":70,"text":1176},{"id":1409,"depth":70,"text":1410},{"id":1538,"depth":60,"text":1539},{"id":1583,"depth":60,"text":1584},{"id":1700,"depth":60,"text":1701},"2026-05-26","Learn JSON Path syntax with practical examples. Master $, @, *, filters, array slicing and see how it compares to XPath for querying JSON.","md",{"immutable":187},"\u002Fguides\u002Fjson-path-syntax",{"title":5,"description":1751},"guides\u002Fjson-path-syntax","zfEjmhk2iILGb8egaZOs4Vgi42gyts-7j005E85vpko",1780401323867]