{"id":6953,"date":"2024-11-14T15:18:16","date_gmt":"2024-11-14T07:18:16","guid":{"rendered":"https:\/\/fwq.ai\/blog\/6953\/"},"modified":"2024-11-14T15:18:16","modified_gmt":"2024-11-14T07:18:16","slug":"mysql-json-%e5%ad%97%e6%ae%b5%e5%88%b0%e5%ba%95%e6%98%af%e5%a6%82%e4%bd%95%e8%bf%90%e4%bd%9c%e7%9a%84%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/6953\/","title":{"rendered":"MySQL JSON \u5b57\u6bb5\u5230\u5e95\u662f\u5982\u4f55\u8fd0\u4f5c\u7684\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173017325120420.jpg\" class=\"aligncenter\" title=\"MySQL JSON \u5b57\u6bb5\u5230\u5e95\u662f\u5982\u4f55\u8fd0\u4f5c\u7684\uff1f\u63d2\u56fe\" alt=\"MySQL JSON \u5b57\u6bb5\u5230\u5e95\u662f\u5982\u4f55\u8fd0\u4f5c\u7684\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>\u63ed\u79d8 MySQL JSON \u5b57\u6bb5\u7684\u8fd0\u4f5c\u673a\u5236<\/strong><\/p>\n<p>\u5728 MySQL \u4e2d\uff0cJSON \u5b57\u6bb5\u7684\u5de5\u4f5c\u539f\u7406\u4e0e\u9884\u671f\u6709\u8f83\u5927\u51fa\u5165\u3002<\/p>\n<p><strong>\u5b58\u50a8\u65b9\u5f0f\uff1a\u4e8c\u8fdb\u5236\u5b57\u7b26\u4e32<\/strong><\/p>\n<p>JSON \u5b57\u6bb5\u672c\u8d28\u4e0a\u662f\u4e8c\u8fdb\u5236\u5b57\u7b26\u4e32\uff0c\u800c\u975e\u6587\u672c\u5b57\u7b26\u4e32\u3002\u8fd9\u4e0e MySQL \u4e2d\u7684 &#8220;BLOB&#8221; \u7c7b\u578b\u7c7b\u4f3c\uff0c\u65e0\u9700\u53cd\u5e8f\u5217\u5316\u5373\u53ef\u76f4\u63a5\u5b58\u50a8\u3002<\/p>\n<p><strong>\u67e5\u8be2\u6548\u7387\uff1a\u90e8\u5206\u53cd\u5e8f\u5217\u5316<\/strong><\/p>\n<p>\u67e5\u8be2\u65f6\uff0cMySQL \u4ec5\u53cd\u5e8f\u5217\u5316\u6240\u9700\u7684\u5b57\u6bb5\uff0c\u800c\u4e0d\u662f\u6574\u4e2a JSON \u5b57\u7b26\u4e32\u3002\u8fd9\u5f97\u76ca\u4e8e\u7c7b\u4f3c JsonPath \u7684\u8bed\u6cd5\u548c\u6309\u952e\u6392\u5e8f\u7684\u5b58\u50a8\u65b9\u5f0f\uff0c\u4ece\u800c\u5927\u5927\u63d0\u9ad8\u4e86\u67e5\u8be2\u6548\u7387\u3002<\/p>\n<p><strong>\u878d\u5408\u4e0e B+ \u6811<\/strong><\/p>\n<p>JSON \u5b57\u6bb5\u5e76\u672a\u4e0e B+ \u6811\u4e2d\u7684\u6570\u636e\u76f8\u878d\u5408\u3002\u76f8\u53cd\uff0c\u5b83\u4eec\u4f5c\u4e3a\u72ec\u7acb\u7684\u5355\u5143\u5b58\u50a8\u5728\u6811\u4e2d\u3002\u89e3\u6790\u65f6\uff0cMySQL \u4f7f\u7528\u7d22\u5f15\u67e5\u627e\u76f8\u5e94\u7684\u5bc6\u94a5\uff0c\u968f\u540e\u4ece\u4e8c\u8fdb\u5236\u5b57\u7b26\u4e32\u4e2d\u63d0\u53d6\u6240\u9700\u503c\u3002<\/p>\n<p><strong>MongoDB \u7684 BSON<\/strong><\/p>\n<p>\u4e0e MySQL \u4e0d\u540c\uff0cMongoDB \u4f7f\u7528 BSON\uff08\u4e8c\u8fdb\u5236 JSON\uff09\u800c\u975e JSON\u3002BSON \u517c\u5bb9 JSON\uff0c\u4f46\u683c\u5f0f\u4e0d\u540c\uff0c\u5e76\u4ee5 K\/V \u65b9\u5f0f\u5b58\u50a8\u5728 WiredTiger \u5f15\u64ce\u4e2d\u3002<\/p>\n<p><strong>\u5408\u7406\u4f7f\u7528\u573a\u666f<\/strong><\/p>\n<p>\u6b63\u5982\u4e00\u4f4d\u793e\u533a\u6210\u5458\u6240\u5efa\u8bae\u7684\uff0cMySQL \u7684 JSON \u5b57\u6bb5\u5bf9\u4e8e\u89e3\u51b3\u65b0\u5217\u6dfb\u52a0\u95ee\u9898\u65f6\u975e\u5e38\u6709\u7528\u3002\u5b83\u53ef\u4ee5\u907f\u514d\u9501\u5b9a\u8868\u548c\u505c\u670d\uff0c\u4f46\u524d\u63d0\u662f\u65b0\u5217\u4e0d\u6d89\u53ca\u7d22\u5f15\uff0c\u5e76\u4e14\u4ec5\u5728\u67e5\u8be2\u540e\u7528\u4e8e\u663e\u793a\u6570\u636e\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662fMySQL JSON \u5b57\u6bb5\u5230\u5e95\u662f\u5982\u4f55\u8fd0\u4f5c\u7684\uff1f\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u7f51\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u63ed\u79d8 MySQL JSON \u5b57\u6bb5\u7684\u8fd0\u4f5c\u673a\u5236 \u5728 MySQL \u4e2d\uff0cJSON \u5b57\u6bb5\u7684\u5de5\u4f5c\u539f\u7406\u4e0e\u9884\u671f\u6709\u8f83\u5927\u51fa\u5165\u3002 \u5b58\u50a8\u65b9\u5f0f\uff1a\u4e8c\u8fdb\u5236\u5b57\u7b26\u4e32 JSON \u5b57\u6bb5\u672c\u8d28\u4e0a\u662f\u4e8c\u8fdb\u5236\u5b57\u7b26\u4e32\uff0c\u800c\u975e\u6587\u672c\u5b57\u7b26\u4e32\u3002\u8fd9\u4e0e MySQL \u4e2d\u7684 &#8220;BLOB&#8221; \u7c7b\u578b\u7c7b\u4f3c\uff0c\u65e0\u9700\u53cd\u5e8f\u5217\u5316\u5373\u53ef\u76f4\u63a5\u5b58\u50a8\u3002 \u67e5\u8be2\u6548\u7387\uff1a\u90e8\u5206\u53cd\u5e8f\u5217\u5316 \u67e5\u8be2\u65f6\uff0cMySQL \u4ec5\u53cd\u5e8f\u5217\u5316\u6240\u9700\u7684\u5b57\u6bb5\uff0c\u800c\u4e0d\u662f\u6574\u4e2a JSON \u5b57\u7b26\u4e32\u3002\u8fd9\u5f97\u76ca\u4e8e\u7c7b\u4f3c JsonPath \u7684\u8bed\u6cd5\u548c\u6309\u952e\u6392\u5e8f\u7684\u5b58\u50a8\u65b9\u5f0f\uff0c\u4ece\u800c\u5927\u5927\u63d0\u9ad8\u4e86\u67e5\u8be2\u6548\u7387\u3002 \u878d\u5408\u4e0e B+ \u6811 JSON \u5b57\u6bb5\u5e76\u672a\u4e0e B+ \u6811\u4e2d\u7684\u6570\u636e\u76f8\u878d\u5408\u3002\u76f8\u53cd\uff0c\u5b83\u4eec\u4f5c\u4e3a\u72ec\u7acb\u7684\u5355\u5143\u5b58\u50a8\u5728\u6811\u4e2d\u3002\u89e3\u6790\u65f6\uff0cMySQL \u4f7f\u7528\u7d22\u5f15\u67e5\u627e\u76f8\u5e94\u7684\u5bc6\u94a5\uff0c\u968f\u540e\u4ece\u4e8c\u8fdb\u5236\u5b57\u7b26\u4e32\u4e2d\u63d0\u53d6\u6240\u9700\u503c\u3002 MongoDB \u7684 BSON \u4e0e MySQL \u4e0d\u540c\uff0cMongoDB \u4f7f\u7528 BSON\uff08\u4e8c\u8fdb\u5236 JSON\uff09\u800c\u975e JSON\u3002BSON \u517c\u5bb9 JSON\uff0c\u4f46\u683c\u5f0f\u4e0d\u540c\uff0c\u5e76\u4ee5 K\/V \u65b9\u5f0f\u5b58\u50a8\u5728 WiredTiger \u5f15\u64ce\u4e2d\u3002 \u5408\u7406\u4f7f\u7528\u573a\u666f \u6b63\u5982\u4e00\u4f4d\u793e\u533a\u6210\u5458\u6240\u5efa\u8bae\u7684\uff0cMySQL \u7684 JSON \u5b57\u6bb5\u5bf9\u4e8e\u89e3\u51b3\u65b0\u5217\u6dfb\u52a0\u95ee\u9898\u65f6\u975e\u5e38\u6709\u7528\u3002\u5b83\u53ef\u4ee5\u907f\u514d\u9501\u5b9a\u8868\u548c\u505c\u670d\uff0c\u4f46\u524d\u63d0\u662f\u65b0\u5217\u4e0d\u6d89\u53ca\u7d22\u5f15\uff0c\u5e76\u4e14\u4ec5\u5728\u67e5\u8be2\u540e\u7528\u4e8e\u663e\u793a\u6570\u636e\u3002 \u4ee5\u4e0a\u5c31\u662fMySQL JSON \u5b57\u6bb5\u5230\u5e95\u662f\u5982\u4f55\u8fd0\u4f5c\u7684\uff1f\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u7f51\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-6953","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6953","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=6953"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6953\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=6953"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=6953"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=6953"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}