"use strict";(self.webpackChunkdocs_site=self.webpackChunkdocs_site||[]).push([[7143],{1970:(e,n,l)=>{l.r(n),l.d(n,{assets:()=>s,contentTitle:()=>i,default:()=>u,frontMatter:()=>d,metadata:()=>r,toc:()=>o});const r=JSON.parse('{"id":"XXTLanControl.lua/kvdb/dict/clear","title":"\u6e05\u7a7a\u8bcd\u5178 (LCC.kvdb.dict.clear)","description":"\u58f0\u660e","source":"@site/docs/XXTLanControl.lua/kvdb/dict/clear.md","sourceDirName":"XXTLanControl.lua/kvdb/dict","slug":"/XXTLanControl.lua/kvdb/dict/clear","permalink":"/docs/XXTLanControl.lua/kvdb/dict/clear","draft":false,"unlisted":false,"tags":[],"version":"current","sidebarPosition":90,"frontMatter":{"sidebar_position":90},"sidebar":"tutorialSidebar","previous":{"title":"\u5220\u9664\u952e\u503c (LCC.kvdb.dict.delete)","permalink":"/docs/XXTLanControl.lua/kvdb/dict/delete"},"next":{"title":"Queue \u961f\u5217\u63a5\u53e3","permalink":"/docs/XXTLanControl.lua/kvdb/queue/"}}');var t=l(4848),c=l(8453);const d={sidebar_position:90},i="\u6e05\u7a7a\u8bcd\u5178 (LCC.kvdb.dict.clear)",s={},o=[{value:"\u58f0\u660e",id:"\u58f0\u660e",level:2},{value:"\u53c2\u6570",id:"\u53c2\u6570",level:2},{value:"\u8fd4\u56de\u503c",id:"\u8fd4\u56de\u503c",level:2},{value:"\u8bf4\u660e",id:"\u8bf4\u660e",level:2},{value:"\u793a\u4f8b",id:"\u793a\u4f8b",level:2}];function a(e){const n={blockquote:"blockquote",br:"br",code:"code",h1:"h1",h2:"h2",header:"header",li:"li",p:"p",pre:"pre",ul:"ul",...(0,c.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.header,{children:(0,t.jsx)(n.h1,{id:"\u6e05\u7a7a\u8bcd\u5178-lcckvdbdictclear",children:"\u6e05\u7a7a\u8bcd\u5178 (LCC.kvdb.dict.clear)"})}),"\n",(0,t.jsx)(n.h2,{id:"\u58f0\u660e",children:"\u58f0\u660e"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-lua",children:"values, err = LCC.kvdb.dict.clear(name, timeout?)\n"})}),"\n",(0,t.jsx)(n.h2,{id:"\u53c2\u6570",children:"\u53c2\u6570"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["name",(0,t.jsx)(n.br,{}),"\n","\u5b57\u7b26\u4e32\u578b\uff0c\u8bcd\u5178\u540d\u79f0\uff08\u975e\u7a7a\uff0c\u6700\u957f ",(0,t.jsx)(n.code,{children:"256"})," \u5b57\u8282\uff09"]}),"\n",(0,t.jsxs)(n.li,{children:["timeout",(0,t.jsx)(n.br,{}),"\n","\u6570\u503c\u578b\uff0c\u53ef\u9009\uff1b\u8bf7\u6c42\u8d85\u65f6\u65f6\u95f4\uff08\u79d2\uff09\uff0c\u9ed8\u8ba4 ",(0,t.jsx)(n.code,{children:"60"})]}),"\n"]}),"\n",(0,t.jsx)(n.h2,{id:"\u8fd4\u56de\u503c",children:"\u8fd4\u56de\u503c"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["values",(0,t.jsx)(n.br,{}),"\n","\u8868\u7c7b\u578b\uff0c\u88ab\u6e05\u7a7a\u524d\u7684\u952e\u503c\u6620\u5c04\uff1b\u8bcd\u5178\u539f\u672c\u4e3a\u7a7a\u65f6\u4e5f\u8fd4\u56de\u7a7a\u8868\uff0c\u5931\u8d25\u65f6\u4e3a ",(0,t.jsx)(n.code,{children:"nil"})]}),"\n",(0,t.jsxs)(n.li,{children:["err",(0,t.jsx)(n.br,{}),"\n","\u5b57\u7b26\u4e32\u578b\u6216 ",(0,t.jsx)(n.code,{children:"nil"}),"\uff0c\u5931\u8d25\u65f6\u7684\u9519\u8bef\u63cf\u8ff0"]}),"\n"]}),"\n",(0,t.jsx)(n.h2,{id:"\u8bf4\u660e",children:"\u8bf4\u660e"}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsxs)(n.p,{children:["\u6e05\u7a7a\u8bcd\u5178\u4e2d\u7684\u6240\u6709\u952e\u503c\uff0c\u5e76\u8fd4\u56de\u6e05\u7a7a\u524d\u7684\u5feb\u7167\u3002",(0,t.jsx)(n.br,{}),"\n","\u53ef\u4ee5\u5c06\u8fd4\u56de\u503c\u5e8f\u5217\u5316\u4f5c\u4e3a\u5907\u4efd\u3002"]}),"\n"]}),"\n",(0,t.jsx)(n.h2,{id:"\u793a\u4f8b",children:"\u793a\u4f8b"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-lua",children:'local values, err = LCC.kvdb.dict.clear("\u4e34\u65f6\u7f13\u5b58")\nif values then\n    local count = 0\n    for _ in pairs(values) do count = count + 1 end\n    LCC.log(1, "\u5df2\u6e05\u7a7a\u7f13\u5b58\u6761\u76ee", count)\nend\n'})})]})}function u(e={}){const{wrapper:n}={...(0,c.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(a,{...e})}):a(e)}},8453:(e,n,l)=>{l.d(n,{R:()=>d,x:()=>i});var r=l(6540);const t={},c=r.createContext(t);function d(e){const n=r.useContext(c);return r.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function i(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:d(e.components),r.createElement(c.Provider,{value:n},e.children)}}}]);