{"id":60599,"date":"2026-01-16T00:33:24","date_gmt":"2026-01-15T16:33:24","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/60599.html"},"modified":"2026-01-16T00:33:24","modified_gmt":"2026-01-15T16:33:24","slug":"redis%e5%91%bd%e4%bb%a4-string%e5%91%bd%e4%bb%a4","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/60599.html","title":{"rendered":"Redis\u547d\u4ee4-String\u547d\u4ee4"},"content":{"rendered":"<h3>\u4e00\u3001\u524d\u8a00&#xff1a;String \u662f Redis \u7684\u201c\u57fa\u77f3\u201d<\/h3>\n<p>\u5728 Redis \u7684\u4e94\u5927\u6570\u636e\u7c7b\u578b\u4e2d&#xff0c;String&#xff08;\u5b57\u7b26\u4e32&#xff09;\u662f\u6700\u57fa\u7840\u3001\u6700\u5e38\u7528\u7684\u4e00\u79cd\u3002<br \/>\n\u5b83\u4e0d\u4ec5\u662f\u7b80\u5355\u7684\u6587\u672c\u5b58\u50a8\u5de5\u5177&#xff0c;\u8fd8\u652f\u6301\u6570\u5b57\u81ea\u589e\u3001\u4e8c\u8fdb\u5236\u6570\u636e\u3001\u539f\u5b50\u64cd\u4f5c\u7b49\u9ad8\u7ea7\u7279\u6027\u3002<\/p>\n<p>&#x1f4cc; \u4e8b\u5b9e&#xff1a;\u8d85\u8fc7 80% \u7684 Redis \u4f7f\u7528\u573a\u666f\u90fd\u57fa\u4e8e String \u7c7b\u578b&#xff01;<\/p>\n<p>\u672c\u6587\u5c06\u5e26\u4f60&#xff1a;<br \/>\n\u2705 \u5168\u9762\u638c\u63e1 String \u7c7b\u578b\u7684\u6838\u5fc3\u547d\u4ee4<br \/>\n\u2705 \u7406\u89e3\u547d\u4ee4\u7684\u539f\u5b50\u6027\u4e0e\u6027\u80fd\u7279\u70b9<br \/>\n\u2705 \u7ed3\u5408\u771f\u5b9e\u4e1a\u52a1\u573a\u666f&#xff08;\u7f13\u5b58\u3001\u8ba1\u6570\u5668\u3001\u5206\u5e03\u5f0f\u9501&#xff09;<br \/>\n\u2705 \u907f\u5f00\u5e38\u89c1\u4f7f\u7528\u8bef\u533a<\/p>\n<hr \/>\n<h3>\u4e8c\u3001String \u7c7b\u578b\u57fa\u672c\u7279\u6027<\/h3>\n<ul>\n<li>Value \u53ef\u4ee5\u662f&#xff1a;\u5b57\u7b26\u4e32\u3001\u6574\u6570\u3001\u6d6e\u70b9\u6570\u3001\u751a\u81f3\u4e8c\u8fdb\u5236\u6570\u636e&#xff08;\u5982\u56fe\u7247\u3001\u5e8f\u5217\u5316\u5bf9\u8c61&#xff09;<\/li>\n<li>\u6700\u5927\u5bb9\u91cf&#xff1a;512 MB&#xff08;\u5355\u4e2a Value&#xff09;<\/li>\n<li>\u5e95\u5c42\u7f16\u7801&#xff1a;int&#xff08;\u5c0f\u6574\u6570&#xff09;\u3001embstr&#xff08;\u77ed\u5b57\u7b26\u4e32&#xff09;\u3001raw&#xff08;\u957f\u5b57\u7b26\u4e32&#xff09;<\/li>\n<li>\u6240\u6709\u64cd\u4f5c\u90fd\u662f\u539f\u5b50\u7684&#xff1a;\u5929\u7136\u7ebf\u7a0b\u5b89\u5168<\/li>\n<\/ul>\n<hr \/>\n<h3>\u4e09\u3001\u6838\u5fc3\u547d\u4ee4\u8be6\u89e3&#xff08;\u9644\u793a\u4f8b&#xff09;<\/h3>\n<h4>1.\u00a0SET key value [EX seconds] [PX milliseconds] [NX|XX]<\/h4>\n<p>\u8bbe\u7f6e Key \u7684\u503c&#xff0c;\u652f\u6301\u591a\u79cd\u9009\u9879\u3002<\/p>\n<p># \u57fa\u7840\u7528\u6cd5<br \/>\nSET username &#034;alice&#034;<\/p>\n<p># \u8bbe\u7f6e\u5e76\u6307\u5b9a\u8fc7\u671f\u65f6\u95f4&#xff08;\u79d2&#xff09;<br \/>\nSET token &#034;abc123&#034; EX 3600<\/p>\n<p># \u8bbe\u7f6e\u5e76\u6307\u5b9a\u8fc7\u671f\u65f6\u95f4&#xff08;\u6beb\u79d2&#xff09;<br \/>\nSET temp_data &#034;hello&#034; PX 5000<\/p>\n<p># \u4ec5\u5f53 key \u4e0d\u5b58\u5728\u65f6\u624d\u8bbe\u7f6e&#xff08;\u5b9e\u73b0\u5206\u5e03\u5f0f\u9501\u7684\u5173\u952e&#xff01;&#xff09;<br \/>\nSET mylock &#034;owner1&#034; NX EX 30<\/p>\n<p># \u4ec5\u5f53 key \u5b58\u5728\u65f6\u624d\u66f4\u65b0<br \/>\nSET config &#034;v2&#034; XX<\/p>\n<p>\u2705\u00a0NX\u00a0&#043;\u00a0EX\u00a0\u7ec4\u5408\u662f\u5b9e\u73b0\u5206\u5e03\u5f0f\u9501\u7684\u6807\u51c6\u65b9\u5f0f\u3002<\/p>\n<hr \/>\n<h4>2.\u00a0GET key<\/h4>\n<p>\u83b7\u53d6 Key \u7684\u503c\u3002<\/p>\n<p>GET username<br \/>\n# \u8fd4\u56de &#034;alice&#034;<\/p>\n<p>GET non_existent_key<br \/>\n# \u8fd4\u56de (nil)<\/p>\n<p>&#x1f4a1; \u6ce8\u610f&#xff1a;\u5bf9\u975e String \u7c7b\u578b\u7684 Key \u6267\u884c\u00a0GET\u00a0\u4f1a\u8fd4\u56de\u9519\u8bef\u3002<\/p>\n<hr \/>\n<h4>3.\u00a0MSET \/ MGET\u00a0\u2014\u2014 \u6279\u91cf\u64cd\u4f5c<\/h4>\n<p>\u51cf\u5c11\u7f51\u7edc\u5f80\u8fd4&#xff0c;\u63d0\u5347\u6027\u80fd\u3002<\/p>\n<p># \u4e00\u6b21\u8bbe\u7f6e\u591a\u4e2a Key<br \/>\nMSET name &#034;bob&#034; age &#034;25&#034; city &#034;Shanghai&#034;<\/p>\n<p># \u4e00\u6b21\u83b7\u53d6\u591a\u4e2a Key<br \/>\nMGET name age city<br \/>\n# \u8fd4\u56de 1) &#034;bob&#034; 2) &#034;25&#034; 3) &#034;Shanghai&#034;<\/p>\n<p>\u26a1 \u6027\u80fd\u4f18\u52bf&#xff1a;1 \u6b21\u00a0MGET\u00a0\u6bd4 3 \u6b21\u00a0GET\u00a0\u5feb 2&#xff5e;3 \u500d&#xff08;\u5c24\u5176\u5728\u9ad8\u5ef6\u8fdf\u7f51\u7edc\u4e0b&#xff09;\u3002<\/p>\n<hr \/>\n<h4>4.\u00a0INCR \/ DECR\u00a0\u2014\u2014 \u539f\u5b50\u81ea\u589e\/\u81ea\u51cf<\/h4>\n<p>\u5bf9\u6570\u503c\u578b String \u8fdb\u884c\u539f\u5b50\u52a0\u51cf&#xff08;\u5373\u4f7f\u521d\u59cb\u503c\u4e0d\u5b58\u5728&#xff0c;\u4e5f\u4ece 0 \u5f00\u59cb&#xff09;\u3002<\/p>\n<p># \u521d\u59cb\u5316\u5e76\u81ea\u589e<br \/>\nINCR page_view:home<br \/>\n# \u8fd4\u56de 1<\/p>\n<p># \u518d\u6b21\u6267\u884c<br \/>\nINCR page_view:home<br \/>\n# \u8fd4\u56de 2<\/p>\n<p># \u81ea\u51cf<br \/>\nDECR stock:iphone<br \/>\n# \u8fd4\u56de -1&#xff08;\u5982\u679c\u521d\u59cb\u4e3a 0&#xff09;<\/p>\n<p># \u6307\u5b9a\u6b65\u957f<br \/>\nINCRBY counter 10   # &#043;10<br \/>\nDECRBY balance 50   # -50<\/p>\n<p>&#x1f512;\u00a0\u5173\u952e\u7279\u6027&#xff1a;\u8fd9\u4e9b\u64cd\u4f5c\u662f\u539f\u5b50\u7684&#xff0c;\u65e0\u9700\u62c5\u5fc3\u5e76\u53d1\u95ee\u9898&#xff01;<\/p>\n<hr \/>\n<h4>5.\u00a0SETEX \/ SETNX\u00a0\u2014\u2014 \u4e13\u7528\u547d\u4ee4&#xff08;\u5df2\u9010\u6b65\u88ab\u00a0SET\u00a0\u66ff\u4ee3&#xff09;<\/h4>\n<ul>\n<li>SETEX key seconds value\u00a0&#061;\u00a0SET key value EX seconds<\/li>\n<li>SETNX key value\u00a0&#061;\u00a0SET key value NX<\/li>\n<\/ul>\n<p>&#x1f4cc; \u5b98\u65b9\u5efa\u8bae&#xff1a;\u4f18\u5148\u4f7f\u7528\u5e26\u9009\u9879\u7684\u00a0SET\u00a0\u547d\u4ee4&#xff0c;\u8bed\u4e49\u66f4\u6e05\u6670&#xff0c;\u529f\u80fd\u66f4\u5168\u3002<\/p>\n<hr \/>\n<h4>6.\u00a0APPEND key value\u00a0\u2014\u2014 \u5b57\u7b26\u4e32\u8ffd\u52a0<\/h4>\n<p>SET log &#034;start&#034;<br \/>\nAPPEND log &#034; -&gt; step1&#034;<br \/>\nAPPEND log &#034; -&gt; step2&#034;<br \/>\nGET log<br \/>\n# \u8fd4\u56de &#034;start -&gt; step1 -&gt; step2&#034;<\/p>\n<p>\u26a0\ufe0f \u6ce8\u610f&#xff1a;\u9891\u7e41\u00a0APPEND\u00a0\u5927\u5b57\u7b26\u4e32\u53ef\u80fd\u5bfc\u81f4\u5185\u5b58\u788e\u7247&#xff0c;\u614e\u7528\u3002<\/p>\n<hr \/>\n<h4>7.\u00a0STRLEN key\u00a0\u2014\u2014 \u83b7\u53d6\u5b57\u7b26\u4e32\u957f\u5ea6<\/h4>\n<p>SET message &#034;Hello Redis&#034;<br \/>\nSTRLEN message<br \/>\n# \u8fd4\u56de 11<\/p>\n<p>\u2705 \u65f6\u95f4\u590d\u6742\u5ea6 O(1)&#xff0c;\u56e0\u4e3a Redis \u5728\u5185\u90e8\u5df2\u8bb0\u5f55\u957f\u5ea6\u3002<\/p>\n<hr \/>\n<h3>\u56db\u3001String \u7c7b\u578b\u7684\u5178\u578b\u5e94\u7528\u573a\u666f<\/h3>\n<h4>\u573a\u666f 1&#xff1a;\u7f13\u5b58\u7b80\u5355\u5bf9\u8c61<\/h4>\n<p># \u4f2a\u4ee3\u7801&#xff1a;\u7f13\u5b58\u7528\u6237\u4fe1\u606f<br \/>\nuser_json &#061; json.dumps({&#034;id&#034;: 1001, &#034;name&#034;: &#034;\u5f20\u4e09&#034;})<br \/>\nredis.setex(&#034;user:1001&#034;, 3600, user_json)<\/p>\n<p># \u8bfb\u53d6<br \/>\ndata &#061; redis.get(&#034;user:1001&#034;)<\/p>\n<p>\u2705 \u4f18\u52bf&#xff1a;\u7b80\u5355\u3001\u9ad8\u6548<br \/>\n\u274c \u5c40\u9650&#xff1a;\u66f4\u65b0\u9700\u5168\u91cf\u8986\u76d6&#xff08;\u8003\u8651\u6539\u7528 Hash&#xff09;<\/p>\n<hr \/>\n<h4>\u573a\u666f 2&#xff1a;\u5206\u5e03\u5f0f\u8ba1\u6570\u5668<\/h4>\n<p># \u63a5\u53e3\u9650\u6d41&#xff1a;\u6bcf\u79d2\u6700\u591a 100 \u6b21<br \/>\nINCR rate_limit:\/api\/v1\/user<br \/>\nEXPIRE rate_limit:\/api\/v1\/user 1  # 1\u79d2\u540e\u81ea\u52a8\u91cd\u7f6e<\/p>\n<p>\u26a1 \u5b9e\u73b0\u6ed1\u52a8\u7a97\u53e3\u9650\u6d41\u7684\u57fa\u7840\u3002<\/p>\n<hr \/>\n<h4>\u573a\u666f 3&#xff1a;\u5206\u5e03\u5f0f\u9501<\/h4>\n<p># \u52a0\u9501&#xff08;30\u79d2\u81ea\u52a8\u91ca\u653e&#xff09;<br \/>\nSET lock:order_create &#034;instance_01&#034; NX EX 30<\/p>\n<p># \u4e1a\u52a1\u903b\u8f91&#8230;<\/p>\n<p># \u91ca\u653e\u9501&#xff08;\u9700 Lua \u811a\u672c\u4fdd\u8bc1\u539f\u5b50\u6027&#xff09;<br \/>\nEVAL &#034;if redis.call(&#039;GET&#039;, KEYS[1]) &#061;&#061; ARGV[1] then return redis.call(&#039;DEL&#039;, KEYS[1]) else return 0 end&#034; 1 lock:order_create instance_01<\/p>\n<p>&#x1f510; \u5173\u952e&#xff1a;\u9501\u503c &#061; \u552f\u4e00\u6807\u8bc6&#xff08;\u5982\u5b9e\u4f8bID&#xff09;&#xff0c;\u9632\u6b62\u8bef\u5220\u4ed6\u4eba\u9501\u3002<\/p>\n<hr \/>\n<h4>\u573a\u666f 4&#xff1a;\u5b58\u50a8\u4e8c\u8fdb\u5236\u6570\u636e<\/h4>\n<ul>\n<li>\u5b58\u50a8\u5e8f\u5217\u5316\u7684 Protobuf \/ Java \u5bf9\u8c61<\/li>\n<li>\u7f13\u5b58\u56fe\u7247 Base64&#xff08;\u4e0d\u63a8\u8350\u5927\u56fe&#xff0c;\u53ef\u7528 URL \u4ee3\u66ff&#xff09;<\/li>\n<\/ul>\n<p>SET avatar:1001 &#034;&lt;base64_data&gt;&#034;<\/p>\n<hr \/>\n<h3>\u4e94\u3001\u5e38\u89c1\u8bef\u533a\u4e0e\u6700\u4f73\u5b9e\u8df5<\/h3>\n<h4>\u274c \u8bef\u533a 1&#xff1a;\u7528 String \u5b58\u5927 JSON \u5e76\u9891\u7e41\u66f4\u65b0<\/h4>\n<p>\u95ee\u9898&#xff1a;\u6bcf\u6b21\u66f4\u65b0\u9700\u53cd\u5e8f\u5217\u5316 \u2192 \u4fee\u6539 \u2192 \u5e8f\u5217\u5316 \u2192 \u5168\u91cf\u5199\u56de<br \/>\n\u5efa\u8bae&#xff1a;\u6539\u7528\u00a0Hash&#xff0c;\u5b57\u6bb5\u7ea7\u66f4\u65b0\u66f4\u9ad8\u6548<\/p>\n<h4>\u274c \u8bef\u533a 2&#xff1a;\u5fd8\u8bb0\u8bbe\u7f6e TTL<\/h4>\n<p>\u540e\u679c&#xff1a;\u7f13\u5b58\u6c38\u4e0d\u8fc7\u671f&#xff0c;\u5185\u5b58\u6301\u7eed\u589e\u957f \u2192 OOM<br \/>\n\u5efa\u8bae&#xff1a;\u6240\u6709\u7f13\u5b58\u5fc5\u987b\u8bbe\u8fc7\u671f\u65f6\u95f4&#xff08;EX\u00a0\/\u00a0PX&#xff09;<\/p>\n<h4>\u274c \u8bef\u533a 3&#xff1a;\u7528\u00a0INCR\u00a0\u5b58\u6d6e\u70b9\u6570<\/h4>\n<p>\u4e8b\u5b9e&#xff1a;INCR\u00a0\u4ec5\u652f\u6301\u6574\u6570&#xff01;\u6d6e\u70b9\u6570\u8bf7\u7528\u00a0INCRBYFLOAT<\/p>\n<p>INCRBYFLOAT price 0.99<\/p>\n<h4>\u2705 \u6700\u4f73\u5b9e\u8df5&#xff1a;<\/h4>\n<ul>\n<li>Key \u547d\u540d\u89c4\u8303&#xff1a;\u4e1a\u52a1:\u5b9e\u4f53:id&#xff08;\u5982\u00a0cache:user:1001&#xff09;<\/li>\n<li>\u4f18\u5148\u4f7f\u7528\u00a0SET\u00a0\u5e26\u9009\u9879&#xff0c;\u66ff\u4ee3\u00a0SETEX\u00a0\/\u00a0SETNX<\/li>\n<li>\u5927 Value \u62c6\u5206&#xff1a;\u5355\u4e2a Value \u4e0d\u8d85\u8fc7 10KB<\/li>\n<li>\u6279\u91cf\u64cd\u4f5c\u7528\u00a0MSET\/MGET<\/li>\n<\/ul>\n<hr \/>\n<h3>\u516d\u3001\u7ed3\u8bed<\/h3>\n<p>\u611f\u8c22\u60a8\u7684\u9605\u8bfb&#xff01;\u5982\u679c\u4f60\u6709\u4efb\u4f55\u7591\u95ee\u6216\u60f3\u8981\u5206\u4eab\u7684\u7ecf\u9a8c&#xff0c;\u8bf7\u5728\u8bc4\u8bba\u533a\u7559\u8a00\u4ea4\u6d41&#xff01;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u3001\u524d\u8a00&#xff1a;String \u662f Redis \u7684\u201c\u57fa\u77f3\u201d\u5728 Redis \u7684\u4e94\u5927\u6570\u636e\u7c7b\u578b\u4e2d&#xff0c;String&#xff08;\u5b57\u7b26\u4e32&#xff09;\u662f\u6700\u57fa\u7840\u3001\u6700\u5e38\u7528\u7684\u4e00\u79cd\u3002<br \/>\n\u5b83\u4e0d\u4ec5\u662f\u7b80\u5355\u7684\u6587\u672c\u5b58\u50a8\u5de5\u5177&#xff0c;\u8fd8\u652f\u6301\u6570\u5b57\u81ea\u589e\u3001\u4e8c\u8fdb\u5236\u6570\u636e\u3001\u539f\u5b50\u64cd\u4f5c\u7b49\u9ad8\u7ea7\u7279\u6027\u3002&#x1f4cc; \u4e8b\u5b9e&#xff1a;\u8d85\u8fc7 80% \u7684 Redis \u4f7f\u7528\u573a\u666f\u90fd\u57fa\u4e8e String \u7c7b\u578b&#xff01;\u672c\u6587\u5c06\u5e26\u4f60&#xff1a;<br \/>\n\u2705 \u5168\u9762\u638c\u63e1 String \u7c7b\u578b\u7684\u6838\u5fc3\u547d\u4ee4<br \/>\n\u2705 \u7406\u89e3\u547d<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[105,100,398],"topic":[],"class_list":["post-60599","post","type-post","status-publish","format-standard","hentry","category-server","tag-redis","tag-100","tag-398"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Redis\u547d\u4ee4-String\u547d\u4ee4 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/60599.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Redis\u547d\u4ee4-String\u547d\u4ee4 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u4e00\u3001\u524d\u8a00&#xff1a;String \u662f Redis \u7684\u201c\u57fa\u77f3\u201d\u5728 Redis \u7684\u4e94\u5927\u6570\u636e\u7c7b\u578b\u4e2d&#xff0c;String&#xff08;\u5b57\u7b26\u4e32&#xff09;\u662f\u6700\u57fa\u7840\u3001\u6700\u5e38\u7528\u7684\u4e00\u79cd\u3002 \u5b83\u4e0d\u4ec5\u662f\u7b80\u5355\u7684\u6587\u672c\u5b58\u50a8\u5de5\u5177&#xff0c;\u8fd8\u652f\u6301\u6570\u5b57\u81ea\u589e\u3001\u4e8c\u8fdb\u5236\u6570\u636e\u3001\u539f\u5b50\u64cd\u4f5c\u7b49\u9ad8\u7ea7\u7279\u6027\u3002&#x1f4cc; \u4e8b\u5b9e&#xff1a;\u8d85\u8fc7 80% \u7684 Redis \u4f7f\u7528\u573a\u666f\u90fd\u57fa\u4e8e String \u7c7b\u578b&#xff01;\u672c\u6587\u5c06\u5e26\u4f60&#xff1a; \u2705 \u5168\u9762\u638c\u63e1 String \u7c7b\u578b\u7684\u6838\u5fc3\u547d\u4ee4 \u2705 \u7406\u89e3\u547d\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/60599.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-01-15T16:33:24+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/60599.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/60599.html\",\"name\":\"Redis\u547d\u4ee4-String\u547d\u4ee4 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-01-15T16:33:24+00:00\",\"dateModified\":\"2026-01-15T16:33:24+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/60599.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/60599.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/60599.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Redis\u547d\u4ee4-String\u547d\u4ee4\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Redis\u547d\u4ee4-String\u547d\u4ee4 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/60599.html","og_locale":"zh_CN","og_type":"article","og_title":"Redis\u547d\u4ee4-String\u547d\u4ee4 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u4e00\u3001\u524d\u8a00&#xff1a;String \u662f Redis \u7684\u201c\u57fa\u77f3\u201d\u5728 Redis \u7684\u4e94\u5927\u6570\u636e\u7c7b\u578b\u4e2d&#xff0c;String&#xff08;\u5b57\u7b26\u4e32&#xff09;\u662f\u6700\u57fa\u7840\u3001\u6700\u5e38\u7528\u7684\u4e00\u79cd\u3002 \u5b83\u4e0d\u4ec5\u662f\u7b80\u5355\u7684\u6587\u672c\u5b58\u50a8\u5de5\u5177&#xff0c;\u8fd8\u652f\u6301\u6570\u5b57\u81ea\u589e\u3001\u4e8c\u8fdb\u5236\u6570\u636e\u3001\u539f\u5b50\u64cd\u4f5c\u7b49\u9ad8\u7ea7\u7279\u6027\u3002&#x1f4cc; \u4e8b\u5b9e&#xff1a;\u8d85\u8fc7 80% \u7684 Redis \u4f7f\u7528\u573a\u666f\u90fd\u57fa\u4e8e String \u7c7b\u578b&#xff01;\u672c\u6587\u5c06\u5e26\u4f60&#xff1a; \u2705 \u5168\u9762\u638c\u63e1 String \u7c7b\u578b\u7684\u6838\u5fc3\u547d\u4ee4 \u2705 \u7406\u89e3\u547d","og_url":"https:\/\/www.wsisp.com\/helps\/60599.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-01-15T16:33:24+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/60599.html","url":"https:\/\/www.wsisp.com\/helps\/60599.html","name":"Redis\u547d\u4ee4-String\u547d\u4ee4 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-01-15T16:33:24+00:00","dateModified":"2026-01-15T16:33:24+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/60599.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/60599.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/60599.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"Redis\u547d\u4ee4-String\u547d\u4ee4"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/60599","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=60599"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/60599\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=60599"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=60599"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=60599"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=60599"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}