_Pear
_Pear
Explore posts from servers
DDeno
Created by _Pear on 3/26/2024 in #help
Help with TypeScript namespaces - is this pattern supported?
Hi! I am attempting to model some classes in a Namespace for organization purposes. I would expect this pattern to work, the linter doesn't complain at least, but when I run deno test it fails with the error in the README. Is this not supported in Deno? I tried using triple slash directives as well but no luck. Thanks! https://github.com/CobyPear/deno-namespace-reproduction
6 replies
DDeno
Created by _Pear on 9/9/2023 in #help
KV list is returning an empty iterator, but data is there and gettable via get
Hello. To simplify things, I am setting a key of ["accounts", account.name] but when I try to get the accounts with kv.list({ prefix: ["accounts"] }), I always get an empty iterator back. I am able to see the record exist when using kv.get(). Here are the relevant snippets; what am I doing wrong, or is this a bug?:
const Db = await Deno.openKv();
//...
await Db.set(["accounts", account.username], account);

//...
const iter = Db.list({ prefix: ["accounts"] }); // why is this always empty?
for await (const row of iter) {
console.log(row);
}
const Db = await Deno.openKv();
//...
await Db.set(["accounts", account.username], account);

//...
const iter = Db.list({ prefix: ["accounts"] }); // why is this always empty?
for await (const row of iter) {
console.log(row);
}
6 replies