{ "title": "@upstash/redis", "description": "A fully typed Redis client built for Upstash Redis and HTTP, perfect for serverless and edge runtimes.", "date": "2022-03-14T00:00:00.000Z", "url": "https://upstash.com/redis", "repository": "upstash/upstash-redis", "body": { "raw": "\n\n`@upstash/redis` is an HTTP/REST based Redis client for typescript, built on top\nof [Upstash REST API](https://docs.upstash.com/features/restapi).\n\nIt is the only connectionless (HTTP based) Redis client and designed for:\n\n- Serverless functions (AWS Lambda ...)\n- Cloudflare Workers (see\n [the example](https://github.com/upstash/upstash-redis/tree/main/examples/cloudflare-workers))\n- Fastly Compute@Edge (see\n [the example](https://github.com/upstash/upstash-redis/tree/main/examples/fastly))\n- Next.js, Jamstack ...\n- Client side web/mobile applications\n- WebAssembly\n- and other environments where HTTP is preferred over TCP.\n\nSee\n[the list of APIs](https://docs.upstash.com/features/restapi#rest---redis-api-compatibility)\nsupported.\n\n## Quick Start\n\n### Install\n\n#### Node.js\n\n```bash\nnpm install @upstash/redis\n```\n\n#### Deno\n\n```ts\nimport { Redis } from \"https://deno.land/x/upstash_redis/mod.ts\";\n```\n\n### Create database\n\nCreate a new redis database on [upstash](https://console.upstash.com/)\n\n## Basic Usage:\n\n```ts\nimport { Redis } from \"@upstash/redis\"\n\nconst redis = new Redis({\n url: ,\n token: ,\n})\n\n// string\nawait redis.set('key', 'value');\nlet data = await redis.get('key');\nconsole.log(data)\n\nawait redis.set('key2', 'value2', {ex: 1});\n\n// sorted set\nawait redis.zadd('scores', { score: 1, member: 'team1' })\ndata = await redis.zrange('scores', 0, 100 )\nconsole.log(data)\n\n// list\nawait redis.lpush('elements', 'magnesium')\ndata = await redis.lrange('elements', 0, 100 )\nconsole.log(data)\n\n// hash\nawait redis.hset('people', {name: 'joe'})\ndata = await redis.hget('people', 'name' )\nconsole.log(data)\n\n// sets\nawait redis.sadd('animals', 'cat')\ndata = await redis.spop('animals', 1)\nconsole.log(data)\n```\n", "code": "var Component=(()=>{var h=Object.create;var c=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var E=Object.getOwnPropertyNames;var y=Object.getPrototypeOf,F=Object.prototype.hasOwnProperty;var m=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports),u=(n,e)=>{for(var s in e)c(n,s,{get:e[s],enumerable:!0})},o=(n,e,s,r)=>{if(e&&typeof e==\"object\"||typeof e==\"function\")for(let a of E(e))!F.call(n,a)&&a!==s&&c(n,a,{get:()=>e[a],enumerable:!(r=p(e,a))||r.enumerable});return n};var B=(n,e,s)=>(s=n!=null?h(y(n)):{},o(e||!n||!n.__esModule?c(s,\"default\",{value:n,enumerable:!0}):s,n)),N=n=>o(c({},\"__esModule\",{value:!0}),n);var t=m((w,i)=>{i.exports=_jsx_runtime});var C={};u(C,{default:()=>b,frontmatter:()=>g});var l=B(t()),g={title:\"@upstash/redis\",description:\"A fully typed Redis client built for Upstash Redis and HTTP, perfect for serverless and edge runtimes.\",date:\"2022-03-14\",url:\"https://upstash.com/redis\",repository:\"upstash/upstash-redis\"};function d(n){let e=Object.assign({p:\"p\",code:\"code\",a:\"a\",ul:\"ul\",li:\"li\",h2:\"h2\",span:\"span\",h3:\"h3\",h4:\"h4\",div:\"div\",pre:\"pre\"},n.components);return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(e.p,{children:[(0,l.jsx)(e.code,{children:\"@upstash/redis\"}),` is an HTTP/REST based Redis client for typescript, built on top\nof `,(0,l.jsx)(e.a,{href:\"https://docs.upstash.com/features/restapi\",children:\"Upstash REST API\"}),\".\"]}),`\n`,(0,l.jsx)(e.p,{children:\"It is the only connectionless (HTTP based) Redis client and designed for:\"}),`\n`,(0,l.jsxs)(e.ul,{children:[`\n`,(0,l.jsx)(e.li,{children:\"Serverless functions (AWS Lambda ...)\"}),`\n`,(0,l.jsxs)(e.li,{children:[`Cloudflare Workers (see\n`,(0,l.jsx)(e.a,{href:\"https://github.com/upstash/upstash-redis/tree/main/examples/cloudflare-workers\",children:\"the example\"}),\")\"]}),`\n`,(0,l.jsxs)(e.li,{children:[`Fastly Compute@Edge (see\n`,(0,l.jsx)(e.a,{href:\"https://github.com/upstash/upstash-redis/tree/main/examples/fastly\",children:\"the example\"}),\")\"]}),`\n`,(0,l.jsx)(e.li,{children:\"Next.js, Jamstack ...\"}),`\n`,(0,l.jsx)(e.li,{children:\"Client side web/mobile applications\"}),`\n`,(0,l.jsx)(e.li,{children:\"WebAssembly\"}),`\n`,(0,l.jsx)(e.li,{children:\"and other environments where HTTP is preferred over TCP.\"}),`\n`]}),`\n`,(0,l.jsxs)(e.p,{children:[`See\n`,(0,l.jsx)(e.a,{href:\"https://docs.upstash.com/features/restapi#rest---redis-api-compatibility\",children:\"the list of APIs\"}),`\nsupported.`]}),`\n`,(0,l.jsxs)(e.h2,{id:\"quick-start\",children:[(0,l.jsx)(e.a,{className:\"subheading-anchor\",\"aria-label\":\"Link to section\",href:\"#quick-start\",children:(0,l.jsx)(e.span,{className:\"icon icon-link\"})}),\"Quick Start\"]}),`\n`,(0,l.jsxs)(e.h3,{id:\"install\",children:[(0,l.jsx)(e.a,{className:\"subheading-anchor\",\"aria-label\":\"Link to section\",href:\"#install\",children:(0,l.jsx)(e.span,{className:\"icon icon-link\"})}),\"Install\"]}),`\n`,(0,l.jsxs)(e.h4,{id:\"nodejs\",children:[(0,l.jsx)(e.a,{className:\"subheading-anchor\",\"aria-label\":\"Link to section\",href:\"#nodejs\",children:(0,l.jsx)(e.span,{className:\"icon icon-link\"})}),\"Node.js\"]}),`\n`,(0,l.jsx)(e.div,{\"data-rehype-pretty-code-fragment\":\"\",children:(0,l.jsx)(e.pre,{\"data-language\":\"bash\",\"data-theme\":\"default\",children:(0,l.jsx)(e.code,{\"data-language\":\"bash\",\"data-theme\":\"default\",children:(0,l.jsxs)(e.span,{className:\"line\",children:[(0,l.jsx)(e.span,{style:{color:\"#B392F0\"},children:\"npm\"}),(0,l.jsx)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,l.jsx)(e.span,{style:{color:\"#9ECBFF\"},children:\"install\"}),(0,l.jsx)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,l.jsx)(e.span,{style:{color:\"#9ECBFF\"},children:\"@upstash/redis\"})]})})})}),`\n`,(0,l.jsxs)(e.h4,{id:\"deno\",children:[(0,l.jsx)(e.a,{className:\"subheading-anchor\",\"aria-label\":\"Link to section\",href:\"#deno\",children:(0,l.jsx)(e.span,{className:\"icon icon-link\"})}),\"Deno\"]}),`\n`,(0,l.jsx)(e.div,{\"data-rehype-pretty-code-fragment\":\"\",children:(0,l.jsx)(e.pre,{\"data-language\":\"ts\",\"data-theme\":\"default\",children:(0,l.jsx)(e.code,{\"data-language\":\"ts\",\"data-theme\":\"default\",children:(0,l.jsxs)(e.span,{className:\"line\",children:[(0,l.jsx)(e.span,{style:{color:\"#F97583\"},children:\"import\"}),(0,l.jsx)(e.span,{style:{color:\"#E1E4E8\"},children:\" { Redis } \"}),(0,l.jsx)(e.span,{style:{color:\"#F97583\"},children:\"from\"}),(0,l.jsx)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,l.jsx)(e.span,{style:{color:\"#9ECBFF\"},children:'\"https://deno.land/x/upstash_redis/mod.ts\"'}),(0,l.jsx)(e.span,{style:{color:\"#E1E4E8\"},children:\";\"})]})})})}),`\n`,(0,l.jsxs)(e.h3,{id:\"create-database\",children:[(0,l.jsx)(e.a,{className:\"subheading-anchor\",\"aria-label\":\"Link to section\",href:\"#create-database\",children:(0,l.jsx)(e.span,{className:\"icon icon-link\"})}),\"Create database\"]}),`\n`,(0,l.jsxs)(e.p,{children:[\"Create a new redis database on \",(0,l.jsx)(e.a,{href:\"https://console.upstash.com/\",children:\"upstash\"})]}),`\n`,(0,l.jsxs)(e.h2,{id:\"basic-usage\",children:[(0,l.jsx)(e.a,{className:\"subheading-anchor\",\"aria-label\":\"Link to section\",href:\"#basic-usage\",children:(0,l.jsx)(e.span,{className:\"icon icon-link\"})}),\"Basic Usage:\"]}),`\n`,(0,l.jsx)(e.div,{\"data-rehype-pretty-code-fragment\":\"\",children:(0,l.jsx)(e.pre,{\"data-language\":\"ts\",\"data-theme\":\"default\",children:(0,l.jsxs)(e.code,{\"data-language\":\"ts\",\"data-theme\":\"default\",children:[(0,l.jsxs)(e.span,{className:\"line\",children:[(0,l.jsx)(e.span,{style:{color:\"#F97583\"},children:\"import\"}),(0,l.jsx)(e.span,{style:{color:\"#E1E4E8\"},children:\" { Redis } \"}),(0,l.jsx)(e.span,{style:{color:\"#F97583\"},children:\"from\"}),(0,l.jsx)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,l.jsx)(e.span,{style:{color:\"#9ECBFF\"},children:'\"@upstash/redis\"'})]}),`\n`,(0,l.jsx)(e.span,{className:\"line\",children:\" \"}),`\n`,(0,l.jsxs)(e.span,{className:\"line\",children:[(0,l.jsx)(e.span,{style:{color:\"#F97583\"},children:\"const\"}),(0,l.jsx)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,l.jsx)(e.span,{style:{color:\"#79B8FF\"},children:\"redis\"}),(0,l.jsx)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,l.jsx)(e.span,{style:{color:\"#F97583\"},children:\"=\"}),(0,l.jsx)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,l.jsx)(e.span,{style:{color:\"#F97583\"},children:\"new\"}),(0,l.jsx)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,l.jsx)(e.span,{style:{color:\"#B392F0\"},children:\"Redis\"}),(0,l.jsx)(e.span,{style:{color:\"#E1E4E8\"},children:\"({\"})]}),`\n`,(0,l.jsxs)(e.span,{className:\"line\",children:[(0,l.jsx)(e.span,{style:{color:\"#E1E4E8\"},children:\" url: <\"}),(0,l.jsx)(e.span,{style:{color:\"#B392F0\"},children:\"UPSTASH_REDIS_REST_URL\"}),(0,l.jsx)(e.span,{style:{color:\"#E1E4E8\"},children:\">,\"})]}),`\n`,(0,l.jsxs)(e.span,{className:\"line\",children:[(0,l.jsx)(e.span,{style:{color:\"#E1E4E8\"},children:\" token: <\"}),(0,l.jsx)(e.span,{style:{color:\"#B392F0\"},children:\"UPSTASH_REDIS_REST_TOKEN\"}),(0,l.jsx)(e.span,{style:{color:\"#E1E4E8\"},children:\">,\"})]}),`\n`,(0,l.jsx)(e.span,{className:\"line\",children:(0,l.jsx)(e.span,{style:{color:\"#E1E4E8\"},children:\"})\"})}),`\n`,(0,l.jsx)(e.span,{className:\"line\",children:\" \"}),`\n`,(0,l.jsx)(e.span,{className:\"line\",children:(0,l.jsx)(e.span,{style:{color:\"#6A737D\"},children:\"// string\"})}),`\n`,(0,l.jsxs)(e.span,{className:\"line\",children:[(0,l.jsx)(e.span,{style:{color:\"#F97583\"},children:\"await\"}),(0,l.jsx)(e.span,{style:{color:\"#E1E4E8\"},children:\" redis.\"}),(0,l.jsx)(e.span,{style:{color:\"#B392F0\"},children:\"set\"}),(0,l.jsx)(e.span,{style:{color:\"#E1E4E8\"},children:\"(\"}),(0,l.jsx)(e.span,{style:{color:\"#9ECBFF\"},children:\"'key'\"}),(0,l.jsx)(e.span,{style:{color:\"#E1E4E8\"},children:\", \"}),(0,l.jsx)(e.span,{style:{color:\"#9ECBFF\"},children:\"'value'\"}),(0,l.jsx)(e.span,{style:{color:\"#E1E4E8\"},children:\");\"})]}),`\n`,(0,l.jsxs)(e.span,{className:\"line\",children:[(0,l.jsx)(e.span,{style:{color:\"#F97583\"},children:\"let\"}),(0,l.jsx)(e.span,{style:{color:\"#E1E4E8\"},children:\" data \"}),(0,l.jsx)(e.span,{style:{color:\"#F97583\"},children:\"=\"}),(0,l.jsx)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,l.jsx)(e.span,{style:{color:\"#F97583\"},children:\"await\"}),(0,l.jsx)(e.span,{style:{color:\"#E1E4E8\"},children:\" redis.\"}),(0,l.jsx)(e.span,{style:{color:\"#B392F0\"},children:\"get\"}),(0,l.jsx)(e.span,{style:{color:\"#E1E4E8\"},children:\"(\"}),(0,l.jsx)(e.span,{style:{color:\"#9ECBFF\"},children:\"'key'\"}),(0,l.jsx)(e.span,{style:{color:\"#E1E4E8\"},children:\");\"})]}),`\n`,(0,l.jsxs)(e.span,{className:\"line\",children:[(0,l.jsx)(e.span,{style:{color:\"#E1E4E8\"},children:\"console.\"}),(0,l.jsx)(e.span,{style:{color:\"#B392F0\"},children:\"log\"}),(0,l.jsx)(e.span,{style:{color:\"#E1E4E8\"},children:\"(data)\"})]}),`\n`,(0,l.jsx)(e.span,{className:\"line\",children:\" \"}),`\n`,(0,l.jsxs)(e.span,{className:\"line\",children:[(0,l.jsx)(e.span,{style:{color:\"#F97583\"},children:\"await\"}),(0,l.jsx)(e.span,{style:{color:\"#E1E4E8\"},children:\" redis.\"}),(0,l.jsx)(e.span,{style:{color:\"#B392F0\"},children:\"set\"}),(0,l.jsx)(e.span,{style:{color:\"#E1E4E8\"},children:\"(\"}),(0,l.jsx)(e.span,{style:{color:\"#9ECBFF\"},children:\"'key2'\"}),(0,l.jsx)(e.span,{style:{color:\"#E1E4E8\"},children:\", \"}),(0,l.jsx)(e.span,{style:{color:\"#9ECBFF\"},children:\"'value2'\"}),(0,l.jsx)(e.span,{style:{color:\"#E1E4E8\"},children:\", {ex: \"}),(0,l.jsx)(e.span,{style:{color:\"#79B8FF\"},children:\"1\"}),(0,l.jsx)(e.span,{style:{color:\"#E1E4E8\"},children:\"});\"})]}),`\n`,(0,l.jsx)(e.span,{className:\"line\",children:\" \"}),`\n`,(0,l.jsx)(e.span,{className:\"line\",children:(0,l.jsx)(e.span,{style:{color:\"#6A737D\"},children:\"// sorted set\"})}),`\n`,(0,l.jsxs)(e.span,{className:\"line\",children:[(0,l.jsx)(e.span,{style:{color:\"#F97583\"},children:\"await\"}),(0,l.jsx)(e.span,{style:{color:\"#E1E4E8\"},children:\" redis.\"}),(0,l.jsx)(e.span,{style:{color:\"#B392F0\"},children:\"zadd\"}),(0,l.jsx)(e.span,{style:{color:\"#E1E4E8\"},children:\"(\"}),(0,l.jsx)(e.span,{style:{color:\"#9ECBFF\"},children:\"'scores'\"}),(0,l.jsx)(e.span,{style:{color:\"#E1E4E8\"},children:\", { score: \"}),(0,l.jsx)(e.span,{style:{color:\"#79B8FF\"},children:\"1\"}),(0,l.jsx)(e.span,{style:{color:\"#E1E4E8\"},children:\", member: \"}),(0,l.jsx)(e.span,{style:{color:\"#9ECBFF\"},children:\"'team1'\"}),(0,l.jsx)(e.span,{style:{color:\"#E1E4E8\"},children:\" })\"})]}),`\n`,(0,l.jsxs)(e.span,{className:\"line\",children:[(0,l.jsx)(e.span,{style:{color:\"#E1E4E8\"},children:\"data \"}),(0,l.jsx)(e.span,{style:{color:\"#F97583\"},children:\"=\"}),(0,l.jsx)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,l.jsx)(e.span,{style:{color:\"#F97583\"},children:\"await\"}),(0,l.jsx)(e.span,{style:{color:\"#E1E4E8\"},children:\" redis.\"}),(0,l.jsx)(e.span,{style:{color:\"#B392F0\"},children:\"zrange\"}),(0,l.jsx)(e.span,{style:{color:\"#E1E4E8\"},children:\"(\"}),(0,l.jsx)(e.span,{style:{color:\"#9ECBFF\"},children:\"'scores'\"}),(0,l.jsx)(e.span,{style:{color:\"#E1E4E8\"},children:\", \"}),(0,l.jsx)(e.span,{style:{color:\"#79B8FF\"},children:\"0\"}),(0,l.jsx)(e.span,{style:{color:\"#E1E4E8\"},children:\", \"}),(0,l.jsx)(e.span,{style:{color:\"#79B8FF\"},children:\"100\"}),(0,l.jsx)(e.span,{style:{color:\"#E1E4E8\"},children:\" )\"})]}),`\n`,(0,l.jsxs)(e.span,{className:\"line\",children:[(0,l.jsx)(e.span,{style:{color:\"#E1E4E8\"},children:\"console.\"}),(0,l.jsx)(e.span,{style:{color:\"#B392F0\"},children:\"log\"}),(0,l.jsx)(e.span,{style:{color:\"#E1E4E8\"},children:\"(data)\"})]}),`\n`,(0,l.jsx)(e.span,{className:\"line\",children:\" \"}),`\n`,(0,l.jsx)(e.span,{className:\"line\",children:(0,l.jsx)(e.span,{style:{color:\"#6A737D\"},children:\"// list\"})}),`\n`,(0,l.jsxs)(e.span,{className:\"line\",children:[(0,l.jsx)(e.span,{style:{color:\"#F97583\"},children:\"await\"}),(0,l.jsx)(e.span,{style:{color:\"#E1E4E8\"},children:\" redis.\"}),(0,l.jsx)(e.span,{style:{color:\"#B392F0\"},children:\"lpush\"}),(0,l.jsx)(e.span,{style:{color:\"#E1E4E8\"},children:\"(\"}),(0,l.jsx)(e.span,{style:{color:\"#9ECBFF\"},children:\"'elements'\"}),(0,l.jsx)(e.span,{style:{color:\"#E1E4E8\"},children:\", \"}),(0,l.jsx)(e.span,{style:{color:\"#9ECBFF\"},children:\"'magnesium'\"}),(0,l.jsx)(e.span,{style:{color:\"#E1E4E8\"},children:\")\"})]}),`\n`,(0,l.jsxs)(e.span,{className:\"line\",children:[(0,l.jsx)(e.span,{style:{color:\"#E1E4E8\"},children:\"data \"}),(0,l.jsx)(e.span,{style:{color:\"#F97583\"},children:\"=\"}),(0,l.jsx)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,l.jsx)(e.span,{style:{color:\"#F97583\"},children:\"await\"}),(0,l.jsx)(e.span,{style:{color:\"#E1E4E8\"},children:\" redis.\"}),(0,l.jsx)(e.span,{style:{color:\"#B392F0\"},children:\"lrange\"}),(0,l.jsx)(e.span,{style:{color:\"#E1E4E8\"},children:\"(\"}),(0,l.jsx)(e.span,{style:{color:\"#9ECBFF\"},children:\"'elements'\"}),(0,l.jsx)(e.span,{style:{color:\"#E1E4E8\"},children:\", \"}),(0,l.jsx)(e.span,{style:{color:\"#79B8FF\"},children:\"0\"}),(0,l.jsx)(e.span,{style:{color:\"#E1E4E8\"},children:\", \"}),(0,l.jsx)(e.span,{style:{color:\"#79B8FF\"},children:\"100\"}),(0,l.jsx)(e.span,{style:{color:\"#E1E4E8\"},children:\" )\"})]}),`\n`,(0,l.jsxs)(e.span,{className:\"line\",children:[(0,l.jsx)(e.span,{style:{color:\"#E1E4E8\"},children:\"console.\"}),(0,l.jsx)(e.span,{style:{color:\"#B392F0\"},children:\"log\"}),(0,l.jsx)(e.span,{style:{color:\"#E1E4E8\"},children:\"(data)\"})]}),`\n`,(0,l.jsx)(e.span,{className:\"line\",children:\" \"}),`\n`,(0,l.jsx)(e.span,{className:\"line\",children:(0,l.jsx)(e.span,{style:{color:\"#6A737D\"},children:\"// hash\"})}),`\n`,(0,l.jsxs)(e.span,{className:\"line\",children:[(0,l.jsx)(e.span,{style:{color:\"#F97583\"},children:\"await\"}),(0,l.jsx)(e.span,{style:{color:\"#E1E4E8\"},children:\" redis.\"}),(0,l.jsx)(e.span,{style:{color:\"#B392F0\"},children:\"hset\"}),(0,l.jsx)(e.span,{style:{color:\"#E1E4E8\"},children:\"(\"}),(0,l.jsx)(e.span,{style:{color:\"#9ECBFF\"},children:\"'people'\"}),(0,l.jsx)(e.span,{style:{color:\"#E1E4E8\"},children:\", {name: \"}),(0,l.jsx)(e.span,{style:{color:\"#9ECBFF\"},children:\"'joe'\"}),(0,l.jsx)(e.span,{style:{color:\"#E1E4E8\"},children:\"})\"})]}),`\n`,(0,l.jsxs)(e.span,{className:\"line\",children:[(0,l.jsx)(e.span,{style:{color:\"#E1E4E8\"},children:\"data \"}),(0,l.jsx)(e.span,{style:{color:\"#F97583\"},children:\"=\"}),(0,l.jsx)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,l.jsx)(e.span,{style:{color:\"#F97583\"},children:\"await\"}),(0,l.jsx)(e.span,{style:{color:\"#E1E4E8\"},children:\" redis.\"}),(0,l.jsx)(e.span,{style:{color:\"#B392F0\"},children:\"hget\"}),(0,l.jsx)(e.span,{style:{color:\"#E1E4E8\"},children:\"(\"}),(0,l.jsx)(e.span,{style:{color:\"#9ECBFF\"},children:\"'people'\"}),(0,l.jsx)(e.span,{style:{color:\"#E1E4E8\"},children:\", \"}),(0,l.jsx)(e.span,{style:{color:\"#9ECBFF\"},children:\"'name'\"}),(0,l.jsx)(e.span,{style:{color:\"#E1E4E8\"},children:\" )\"})]}),`\n`,(0,l.jsxs)(e.span,{className:\"line\",children:[(0,l.jsx)(e.span,{style:{color:\"#E1E4E8\"},children:\"console.\"}),(0,l.jsx)(e.span,{style:{color:\"#B392F0\"},children:\"log\"}),(0,l.jsx)(e.span,{style:{color:\"#E1E4E8\"},children:\"(data)\"})]}),`\n`,(0,l.jsx)(e.span,{className:\"line\",children:\" \"}),`\n`,(0,l.jsx)(e.span,{className:\"line\",children:(0,l.jsx)(e.span,{style:{color:\"#6A737D\"},children:\"// sets\"})}),`\n`,(0,l.jsxs)(e.span,{className:\"line\",children:[(0,l.jsx)(e.span,{style:{color:\"#F97583\"},children:\"await\"}),(0,l.jsx)(e.span,{style:{color:\"#E1E4E8\"},children:\" redis.\"}),(0,l.jsx)(e.span,{style:{color:\"#B392F0\"},children:\"sadd\"}),(0,l.jsx)(e.span,{style:{color:\"#E1E4E8\"},children:\"(\"}),(0,l.jsx)(e.span,{style:{color:\"#9ECBFF\"},children:\"'animals'\"}),(0,l.jsx)(e.span,{style:{color:\"#E1E4E8\"},children:\", \"}),(0,l.jsx)(e.span,{style:{color:\"#9ECBFF\"},children:\"'cat'\"}),(0,l.jsx)(e.span,{style:{color:\"#E1E4E8\"},children:\")\"})]}),`\n`,(0,l.jsxs)(e.span,{className:\"line\",children:[(0,l.jsx)(e.span,{style:{color:\"#E1E4E8\"},children:\"data \"}),(0,l.jsx)(e.span,{style:{color:\"#F97583\"},children:\"=\"}),(0,l.jsx)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,l.jsx)(e.span,{style:{color:\"#F97583\"},children:\"await\"}),(0,l.jsx)(e.span,{style:{color:\"#E1E4E8\"},children:\" redis.\"}),(0,l.jsx)(e.span,{style:{color:\"#B392F0\"},children:\"spop\"}),(0,l.jsx)(e.span,{style:{color:\"#E1E4E8\"},children:\"(\"}),(0,l.jsx)(e.span,{style:{color:\"#9ECBFF\"},children:\"'animals'\"}),(0,l.jsx)(e.span,{style:{color:\"#E1E4E8\"},children:\", \"}),(0,l.jsx)(e.span,{style:{color:\"#79B8FF\"},children:\"1\"}),(0,l.jsx)(e.span,{style:{color:\"#E1E4E8\"},children:\")\"})]}),`\n`,(0,l.jsxs)(e.span,{className:\"line\",children:[(0,l.jsx)(e.span,{style:{color:\"#E1E4E8\"},children:\"console.\"}),(0,l.jsx)(e.span,{style:{color:\"#B392F0\"},children:\"log\"}),(0,l.jsx)(e.span,{style:{color:\"#E1E4E8\"},children:\"(data)\"})]})]})})})]})}function f(n={}){let{wrapper:e}=n.components||{};return e?(0,l.jsx)(e,Object.assign({},n,{children:(0,l.jsx)(d,n)})):d(n)}var b=f;return N(C);})();\n;return Component;" }, "_id": "projects/upstash-redis.mdx", "_raw": { "sourceFilePath": "projects/upstash-redis.mdx", "sourceFileName": "upstash-redis.mdx", "sourceFileDir": "projects", "contentType": "mdx", "flattenedPath": "projects/upstash-redis" }, "type": "Project", "path": "/projects/upstash-redis", "slug": "upstash-redis" }