{"id":18117,"date":"2025-05-18T09:48:08","date_gmt":"2025-05-18T01:48:08","guid":{"rendered":"https:\/\/www.orczhou.com\/?p=18117"},"modified":"2025-05-26T18:32:14","modified_gmt":"2025-05-26T10:32:14","slug":"mysql-json-path-how-to-and-samples","status":"publish","type":"post","link":"https:\/\/www.orczhou.com\/index.php\/2025\/05\/mysql-json-path-how-to-and-samples\/","title":{"rendered":"\u5728Schema-Less\u573a\u666f\u4e0b\u4f7f\u7528MySQL\uff1aMySQL JSON Path\u7684\u4f7f\u7528"},"content":{"rendered":"<div id=\"tocer-1\" class=\"tocer tocer-pos-flt-e\"><div class=\"tocer-toc\"><header class=\"tocer-header\"><h2 class=\"tocer-title\">\u76ee\u5f55<\/h2>\n<\/header>\n<ul class=\"tocer-list tocer-adv tocer-sp-os-bf tocer-st-ctrs-dec tocer-lvl1\"><li class=\"tocer-has-sub\"><div><a href=\"#tocer-heading-1\">\u4ec0\u4e48\u662f JSON Path\uff1f<\/a><\/div>\n<ul class=\"tocer-sublist tocer-lvl2\"><li><div><a href=\"#tocer-heading-2\">\u57fa\u7840\u8bed\u6cd5\u8bf4\u660e<\/a><\/div><\/li>\n<\/ul>\n<\/li>\n<li class=\"tocer-has-sub\"><div><a href=\"#tocer-heading-3\">JSON Path \u57fa\u672c\u793a\u4f8b<\/a><\/div>\n<ul class=\"tocer-sublist tocer-lvl2\"><li><div><a href=\"#tocer-heading-4\">\u793a\u4f8b\u8868\u4e0e\u793a\u4f8b\u6570\u636e<\/a><\/div><\/li>\n<li><div><a href=\"#tocer-heading-5\">\u63d0\u53d6\u5bf9\u8c61\u5b57\u6bb5<\/a><\/div><\/li>\n<li><div><a href=\"#tocer-heading-6\">\u8bbf\u95ee\u6570\u7ec4\u5143\u7d20<\/a><\/div><\/li>\n<li><div><a href=\"#tocer-heading-7\">\u8bbf\u95ee\u6570\u7ec4\u7684\u8303\u56f4<\/a><\/div><\/li>\n<\/ul>\n<\/li>\n<li class=\"tocer-has-sub\"><div><a href=\"#tocer-heading-8\">\u4f7f\u7528\u901a\u914d\u7b26<\/a><\/div>\n<ul class=\"tocer-sublist tocer-lvl2\"><li><div><a href=\"#tocer-heading-9\">\u51c6\u5907\u793a\u4f8b\u6570\u636e<\/a><\/div><\/li>\n<li><div><a href=\"#tocer-heading-10\">\u4f7f\u7528\u901a\u914d\u7b26\u67e5\u8be2\u6240\u6709book<\/a><\/div><\/li>\n<\/ul>\n<\/li>\n<li class=\"tocer-has-sub\"><div><a href=\"#tocer-heading-11\">\u4f7f\u7528\u901a\u914d\u7b26\u9012\u5f52\u67e5\u8be2<\/a><\/div>\n<ul class=\"tocer-sublist tocer-lvl2\"><li><div><a href=\"#tocer-heading-12\">\u5217\u51fa\u6240\u6709\u4e66\u5e97\u4e2d\u7684\u4e66\u540d<\/a><\/div><\/li>\n<\/ul>\n<\/li>\n<li><div><a href=\"#tocer-heading-13\">\u5c0f\u7ed3<\/a><\/div><\/li>\n<\/ul>\n<\/div><\/div>\n\n\n\n<p>\u968f\u7740 MySQL \u5bf9 JSON \u7c7b\u578b\u7684\u539f\u751f\u652f\u6301\uff0c\u64cd\u4f5c JSON \u6570\u636e\u5df2\u53d8\u5f97\u975e\u5e38\u9ad8\u6548\u4e0e\u5f3a\u5927\u3002\u5728\u8fc7\u53bb\u6570\u5e74\u7684\u7248\u672c\u4e2d\uff0cMySQL \u4e5f\u5728\u4e0d\u65ad\u5730\u589e\u5f3a JSON \u5904\u7406\u76f8\u5173\u7684\u529f\u80fd\u3002\u5728 JSON \u5904\u7406\u4e2d\u9700\u8981\u975e\u5e38\u9891\u7e41\u7684\u4f7f\u7528\u201cJSON Path\u201d \u8bed\u6cd5\uff0c\u800c\u8fd9\u90e8\u5206\u53c8\u662f\u7565\u5fae\u590d\u6742\u7684\u90e8\u5206\uff0c\u672c\u6587\u5c06\u7cfb\u7edf\u7684\u4ecb\u7ecd\u5982\u4f55\u5728 MySQL \u4e2d\u4f7f\u7528 JSON Path\uff0c\u5305\u62ec\u8bed\u6cd5\u89c4\u5219\u3001\u5404\u79cd\u901a\u914d\u7b26\u7528\u6cd5\u3001\u9012\u5f52\u5339\u914d\u7b49\u9ad8\u7ea7\u6280\u5de7\uff0c\u5e76\u901a\u8fc7\u4e30\u5bcc\u793a\u4f8b\u5e2e\u52a9\u5f00\u53d1\u8005\u5feb\u901f\u638c\u63e1\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u4ec0\u4e48\u662f JSON Path\uff1f<\/h3>\n\n\n\n<p><strong>JSON Path<\/strong> \u662f\u4e00\u79cd\u8868\u793a\u6cd5\uff0c\u7528\u6765\u63cf\u8ff0\u5982\u4f55\u5728 JSON \u6587\u6863\u4e2d\u5b9a\u4f4d\u6570\u636e\u3002\u7c7b\u4f3c\u4e8e\u6587\u4ef6\u7cfb\u7edf\u8def\u5f84\uff0cJSON Path \u6307\u5f15\u7740\u4ece JSON \u6839\u8282\u70b9\u51fa\u53d1\uff0c\u9010\u6b65\u6df1\u5165\u7ed3\u6784\u5185\u90e8\u3002\u5728 MySQL \u4e2d\uff0c\u51e0\u4e4e\u6240\u6709\u7684 <code>JSON<\/code>\u76f8\u5173\u7684\u51fd\u6570\u90fd\u4f1a\u4f7f\u7528\u5230\uff0c\u5305\u62ec\uff1a<code>JSON_EXTRACT()<\/code>\u3001<code>JSON_SET()<\/code>\u3001<code>JSON_REPLACE()<\/code>\u3001<code>JSON_REMOVE()<\/code>\u3001<code>JSON_CONTAINS()<\/code>\u7b49\u3002<\/p>\n\n\n\n<p>\u6211\u4eec\u770b\u5230\u7684\u573a\u666f\u7684\u5199\u6cd5\u7c7b\u4f3c\u4e8e\uff1a<code>$.name<\/code>\u3001<code>$.colors[0]<\/code>\u3001<code>$.store**.price<\/code>\u7b49\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\u57fa\u7840\u8bed\u6cd5\u8bf4\u660e<\/h4>\n\n\n\n<p><code>JSON Path<\/code>\u7684\u57fa\u7840\u8bed\u6cd5\uff0c\u9075\u5faa\u4ee5\u4e0b\u89c4\u5219\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>$<\/code>\uff1a\u8868\u793a JSON \u6587\u6863\u7684\u6839\u8282\u70b9\u3002<\/li>\n\n\n\n<li><code>.<\/code>\uff1a\u7528\u4e8e\u8bbf\u95ee\u5bf9\u8c61\u4e2d\u7684\u5c5e\u6027\u3002<\/li>\n\n\n\n<li><code>[\"key\"]<\/code>\uff1a\u53e6\u4e00\u79cd\u8bbf\u95ee\u5bf9\u8c61\u5c5e\u6027\u7684\u65b9\u5f0f\uff0c\u9002\u5408\u5904\u7406\u7279\u6b8a\u5b57\u7b26\u7684 key\u3002<\/li>\n\n\n\n<li><code>[index]<\/code>\uff1a\u8bbf\u95ee\u6570\u7ec4\u4e2d\u7684\u5143\u7d20\u3002<\/li>\n\n\n\n<li><code>*<\/code>\uff1a\u901a\u914d\u7b26\uff0c\u5339\u914d\u6240\u6709\u5b50\u5143\u7d20\u3002<\/li>\n\n\n\n<li><code>**<\/code>\uff1a\u9012\u5f52\u901a\u914d\u7b26\uff0c\u5339\u914d\u6240\u6709\u5d4c\u5957\u5c42\u7ea7\u7684\u5143\u7d20<\/li>\n\n\n\n<li><code>[start to end]<\/code>\uff1a\u6570\u7ec4\u8303\u56f4\u9009\u62e9<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">JSON Path \u57fa\u672c\u793a\u4f8b<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">\u793a\u4f8b\u8868\u4e0e\u793a\u4f8b\u6570\u636e<\/h4>\n\n\n\n<p>\u521b\u5efa\u5e26 <code>JSON<\/code>\u5b57\u6bb5\u7684\u8868\uff0c\u5e76\u5199\u5165\u6570\u636e\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"sql\" class=\"language-sql\">CREATE TABLE t1 (\n    id INT PRIMARY KEY AUTO_INCREMENT,\n    data JSON\n);\n\nINSERT INTO t1 (data) VALUES\n('{\n  \"name\": \"Alice\",\n  \"age\": 25,\n  \"email\": \"alice@example.com\"\n}');<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\u63d0\u53d6\u5bf9\u8c61\u5b57\u6bb5<\/h4>\n\n\n\n<p>\u8fd9\u91cc\u4f7f\u7528\u57fa\u672c\u7684<code>$.name<\/code>\u5f15\u7528\u6839\u8282\u70b9\u4e2d\u5c5e\u6027\u4e3a<code>name<\/code>\u7684\u5bf9\u8c61\uff0c\u793a\u4f8b\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"sql\" class=\"language-sql\">mysql> SELECT JSON_EXTRACT(data, '$.name') FROM t1;\n+------------------------------+\n| JSON_EXTRACT(data, '$.name') |\n+------------------------------+\n| \"Alice\"                      |\n+------------------------------+\n1 row in set (0.00 sec)<\/code><\/pre>\n\n\n\n<p>\u4e5f\u53ef\u4ee5\u4f7f\u7528\u5982\u4e0b\u7b49\u4ef7\u7684\u5199\u6cd5<code>data->'$.name'<\/code>\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"sql\" class=\"language-sql\">mysql> SELECT data->'$.name' FROM t1;\n+----------------+\n| data->'$.name' |\n+----------------+\n| \"Alice\"        |\n+----------------+<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">\u8bbf\u95ee\u6570\u7ec4\u5143\u7d20<\/h4>\n\n\n\n<p>\u521d\u59cb\u5316\u5982\u4e0b\u6570\u636e\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"sql\" class=\"language-sql\">-- truncate table t1;\n\nINSERT INTO t1 (data) VALUES\n('{\n  \"colors\": [\"red\", \"green\", \"blue\"]\n}');<\/code><\/pre>\n\n\n\n<p>\u5148\u8bbf\u95ee<code>colors<\/code>\u5c5e\u6027\uff0c\u518d\u67e5\u627e\u8be5\u6570\u7ec4\u5bf9\u8c61\u7684\u7b2c\u4e00\u4e2a\u5143\u7d20\uff08\u6ce8\u610f\uff1a\u7f16\u53f7\u662f0\uff09\uff0c\u6545 <code>JSON Path<\/code> \u4e3a<code>$.colors[0]<\/code>\uff0c\u793a\u4f8b\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"sql\" class=\"language-sql\">mysql> SELECT data->'$.colors[0]' AS first_color FROM t1;\n+-------------+\n| first_color |\n+-------------+\n| \"red\"       |\n+-------------+<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">\u8bbf\u95ee\u6570\u7ec4\u7684\u8303\u56f4<\/h4>\n\n\n\n<p>\u9664\u4e86\u50cf\u4e0a\u8ff0\u5c55\u793a\u7684\uff0c\u53ef\u4ee5\u4f7f\u7528\u6570\u503c\u8bbf\u95ee\u6570\u7ec4\u5916\uff0c\u8fd8\u53ef\u4ee5\u4f7f\u7528<code>0 to 1<\/code>\u8fd9\u6837\u7684\u8bed\u6cd5\u8868\u793a\u4e00\u4e2a\u8303\u56f4\uff0c\u5e76\u8bbf\u95ee\u6570\u7ec4\u4e2d\u7684\u591a\u4e2a\u5143\u7d20\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"sql\" class=\"language-sql\">mysql> SELECT data->'$.colors[0 to 1]' AS first_color FROM t1;\n+------------------+\n| first_color      |\n+------------------+\n| [\"red\", \"green\"] |\n+------------------+\n\nmysql> SELECT data->'$.colors[1 to 1]' AS first_color FROM t1;\n+-------------+\n| [\"green\"]   |\n+-------------+\n\nmysql> SELECT data->'$.colors[1 to 2]' AS first_color FROM t1;\n+-------------------+\n| [\"green\", \"blue\"] |\n+-------------------+<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">\u4f7f\u7528\u901a\u914d\u7b26<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">\u51c6\u5907\u793a\u4f8b\u6570\u636e<\/h4>\n\n\n\n<p>\u4e3a\u4e86\u5c55\u793a\u76f8\u5173\u7684\u793a\u4f8b\uff0c\u8fd9\u91cc\u5148\u7ed9\u51fa\u4e00\u4e2a\u66f4\u4e3a\u590d\u6742\u7684\u793a\u4f8b\u6570\u636e\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"sql\" class=\"language-sql\">CREATE TABLE t1 (\n    id INT PRIMARY KEY AUTO_INCREMENT,\n    data JSON\n);\n-- truncate table t1;\n\nINSERT INTO t1 (data) VALUES\n('{\n  \"store\": {\n    \"book\": [\n      {\n        \"category\": \"fiction\",\n        \"title\": \"Harry Potter\",\n        \"price\": 29.99\n      },\n      {\n        \"category\": \"fiction\",\n        \"title\": \"Lord of the Rings\",\n        \"price\": 49.99\n      }\n    ],\n    \"bicycle\": {\n      \"color\": \"red\",\n      \"price\": 19.95\n    }\n  }\n}');<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">\u4f7f\u7528\u901a\u914d\u7b26\u67e5\u8be2\u6240\u6709book<\/h4>\n\n\n\n<p>\u5219\u53ef\u4ee5\u4f7f\u7528\u5982\u4e0b\u7684\u641c\u7d22\u8868\u8fbe\u5f0f\uff1a<code>$.store.book[*]<\/code>\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"sql\" class=\"language-sql\">SELECT data->'$.store.book[*]' AS all_books \nFROM t1;\n\nmysql> SELECT data->'$.store.book[*]' AS all_books\n    -> FROM t1;\n+--------------------------------------------------------------+\n| all_books                                                    |\n+--------------------------------------------------------------+\n| [{\"price\": 29.99, \"title\"...}, {\"price\": 49.99, \"title\"...}] |\n+--------------------------------------------------------------+<\/code><\/pre>\n\n\n\n<p>\u8fd9\u91cc\u6bd4\u8f83\u5bb9\u6613\u9519\u8bef\u7684\u5199\u6210\uff1a<code>$.store.book.*<\/code>\u3001<code>$.store.book.[*]<\/code>\u6216<code>$.store.book*<\/code>\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u4f7f\u7528\u901a\u914d\u7b26\u9012\u5f52\u67e5\u8be2<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">\u5217\u51fa\u6240\u6709\u4e66\u5e97\u4e2d\u7684\u4e66\u540d<\/h4>\n\n\n\n<p>\u4f9d\u65e7\u4f7f\u7528\u4e0a\u8ff0\u7684\u6570\u636e\uff0c\u8fd9\u91cc\u53ef\u4ee5\u4f7f\u7528\u9012\u5f52\u7684\u901a\u914d\u7b26\uff08<code>**<\/code>\uff09\u67e5\u8be2\u7ed3\u6784\u4e2d\u6240\u6709<code>title<\/code>\u5c5e\u6027\u7684\u53d6\u503c\uff0c\u5219<code>'$.store**.title'<\/code>\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"sql\" class=\"language-sql\">SELECT data->'$.store**.title' AS all_books \nFROM t1;\n+---------------------------------------+\n| all_books                             |\n+---------------------------------------+\n| [\"Harry Potter\", \"Lord of the Rings\"] |\n+---------------------------------------+<\/code><\/pre>\n\n\n\n<p>\u5f53\u7136\uff0c\u4e5f\u53ef\u4ee5\u6539\u6210\u76f4\u63a5\u4ece\u201c\u6839\u201d\u5904\u5f00\u59cb\u9012\u5f52\u67e5\u627e\uff0c\u5373<code>$**.title<\/code><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"sql\" class=\"language-sql\">mysql> SELECT data->'$**.title' AS all_books  FROM t1;\n+---------------------------------------+\n| all_books                             |\n+---------------------------------------+\n| [\"Harry Potter\", \"Lord of the Rings\"] |\n+---------------------------------------+<\/code><\/pre>\n\n\n\n<p>\u7c7b\u4f3c\u7684\uff0c\u6211\u4eec\u8fd8\u53ef\u4ee5\u53d6\u51fa\u6240\u6709\u7684\u4ef7\u683c\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"sql\" class=\"language-sql\">SELECT \n  data->'$.store**.price' AS book_prices \nFROM t1;\n+-----------------------+\n| book_prices           |\n+-----------------------+\n| [29.99, 49.99, 19.95] |\n+-----------------------+<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">\u5c0f\u7ed3<\/h3>\n\n\n\n<p>\u719f\u6089 <strong>MySQL JSON Path Syntax<\/strong> \u53ef\u4ee5\u8ba9\u5f00\u53d1\u8005\u66f4\u52a0\u9ad8\u6548\u64cd\u4f5c JSON \u6570\u636e\u3002\u66f4\u591a\u53c2\u8003\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/dev.mysql.com\/doc\/refman\/9.3\/en\/json.html#json-paths\">The JSON Data Type @ MySQL Reference Manual<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u968f\u7740 MySQL \u5bf9 JSON \u7c7b\u578b\u7684\u539f\u751f\u652f\u6301\uff0c\u64cd\u4f5c JSON \u6570\u636e\u5df2\u53d8\u5f97\u975e\u5e38\u9ad8\u6548\u4e0e\u5f3a\u5927\u3002\u5728\u8fc7\u53bb\u6570\u5e74\u7684\u7248\u672c\u4e2d\uff0cMySQL \u4e5f\u5728\u4e0d\u65ad\u5730\u589e\u5f3a JSON \u5904\u7406\u76f8\u5173\u7684\u529f\u80fd\u3002\u5728 JSON \u5904\u7406\u4e2d\u9700\u8981\u975e\u5e38\u9891\u7e41\u7684\u4f7f\u7528\u201cJSON Path\u201d \u8bed\u6cd5\uff0c\u800c\u8fd9\u90e8\u5206\u53c8\u662f\u7565\u5fae\u590d\u6742\u7684\u90e8\u5206\uff0c\u672c\u6587\u5c06\u7cfb\u7edf\u7684\u4ecb\u7ecd\u5982\u4f55\u5728 MySQL \u4e2d\u4f7f\u7528 JSON Path\uff0c\u5305\u62ec\u8bed\u6cd5\u89c4\u5219\u3001\u5404\u79cd\u901a\u914d\u7b26\u7528\u6cd5\u3001\u9012\u5f52\u5339\u914d\u7b49\u9ad8\u7ea7\u6280\u5de7\uff0c\u5e76\u901a\u8fc7\u4e30\u5bcc\u793a\u4f8b\u5e2e\u52a9\u5f00\u53d1\u8005\u5feb\u901f\u638c\u63e1\u3002 \u4ec0\u4e48\u662f JSON Path\uff1f JSON Path \u662f\u4e00\u79cd\u8868\u793a\u6cd5\uff0c\u7528\u6765\u63cf\u8ff0\u5982\u4f55\u5728 JSON \u6587\u6863\u4e2d\u5b9a\u4f4d\u6570\u636e\u3002\u7c7b\u4f3c\u4e8e\u6587\u4ef6\u7cfb\u7edf\u8def\u5f84\uff0cJSON Path \u6307\u5f15\u7740\u4ece JSON \u6839\u8282\u70b9\u51fa\u53d1\uff0c\u9010\u6b65\u6df1\u5165\u7ed3\u6784\u5185\u90e8\u3002\u5728 MySQL \u4e2d\uff0c\u51e0\u4e4e\u6240\u6709\u7684 JSON\u76f8\u5173\u7684\u51fd\u6570\u90fd\u4f1a\u4f7f\u7528\u5230\uff0c\u5305\u62ec\uff1aJSON_EXTRACT()\u3001JSON_SET()\u3001JSON_REPLACE()\u3001JSON_REMOVE()\u3001JSON_CONTAINS()\u7b49\u3002 \u6211\u4eec\u770b\u5230\u7684\u573a\u666f\u7684\u5199\u6cd5\u7c7b\u4f3c\u4e8e\uff1a$.name\u3001$.colors[0]\u3001$.store**.price\u7b49\u3002 \u57fa\u7840\u8bed\u6cd5\u8bf4\u660e JSON Path\u7684\u57fa\u7840\u8bed\u6cd5\uff0c\u9075\u5faa\u4ee5\u4e0b\u89c4\u5219\uff1a JSON Path \u57fa\u672c\u793a\u4f8b \u793a\u4f8b\u8868\u4e0e\u793a\u4f8b\u6570\u636e \u521b\u5efa\u5e26 JSON\u5b57\u6bb5\u7684\u8868\uff0c\u5e76\u5199\u5165\u6570\u636e\uff1a \u63d0\u53d6\u5bf9\u8c61\u5b57\u6bb5 \u8fd9\u91cc\u4f7f\u7528\u57fa\u672c\u7684$.name\u5f15\u7528\u6839\u8282\u70b9\u4e2d\u5c5e\u6027\u4e3aname\u7684\u5bf9\u8c61\uff0c\u793a\u4f8b\u5982\u4e0b\uff1a \u4e5f\u53ef\u4ee5\u4f7f\u7528\u5982\u4e0b\u7b49\u4ef7\u7684\u5199\u6cd5data->&#8217;$.name&#8217;\uff1a \u8bbf\u95ee\u6570\u7ec4\u5143\u7d20 \u521d\u59cb\u5316\u5982\u4e0b\u6570\u636e\uff1a \u5148\u8bbf\u95eecolors\u5c5e\u6027\uff0c\u518d\u67e5\u627e\u8be5\u6570\u7ec4\u5bf9\u8c61\u7684\u7b2c\u4e00\u4e2a\u5143\u7d20\uff08\u6ce8\u610f\uff1a\u7f16\u53f7\u662f0\uff09\uff0c\u6545 JSON Path \u4e3a$.colors[0]\uff0c\u793a\u4f8b\u5982\u4e0b\uff1a \u8bbf\u95ee\u6570\u7ec4\u7684\u8303\u56f4 \u9664\u4e86\u50cf\u4e0a\u8ff0\u5c55\u793a\u7684\uff0c\u53ef\u4ee5\u4f7f\u7528\u6570\u503c\u8bbf\u95ee\u6570\u7ec4\u5916\uff0c\u8fd8\u53ef\u4ee5\u4f7f\u75280 to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":18131,"comment_status":"open","ping_status":"closed","sticky":false,"template":"wp-custom-template-a-1440-px-width-template","format":"standard","meta":{"_eb_attr":"","inline_featured_image":false,"_tocer_settings":[],"footnotes":""},"categories":[1],"tags":[],"class_list":["post-18117","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-simplelife"],"_links":{"self":[{"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/posts\/18117","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/comments?post=18117"}],"version-history":[{"count":17,"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/posts\/18117\/revisions"}],"predecessor-version":[{"id":18739,"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/posts\/18117\/revisions\/18739"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/media\/18131"}],"wp:attachment":[{"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/media?parent=18117"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/categories?post=18117"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/tags?post=18117"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}