1
2
3
4
5
6
7
8
9
10
11
12
13
import { Redis } from "npm:@upstash/redis";
const redis = new Redis({
url: Deno.env.get("upstashURL"),
token: Deno.env.get("upstashToken"),
});
// Just string
// console.log(await redis.set("foo", "bar")); // OK
// console.log(await redis.get("foo")); // bar
// JSON
await redis.set("json-ex-1", { a: { b: "nested json" } });
console.log(((await redis.get("json-ex-1")) as any).a.b);