DenoDDeno
Powered by
ÓscarÓ
Deno•3y ago•
2 replies
Óscar

What is the best way to count values with Deno.Kv?

I want to show the total values in the database. It seems that the only way is with
kv.list()
kv.list()
and then iterate the values.

Probably this is not very performant if I only want to count the results. I'd like to have something like this:

const count = await kv.count(["users"]);

console.log(`There are ${count} users in the database`);
const count = await kv.count(["users"]);

console.log(`There are ${count} users in the database`);
Deno banner
DenoJoin
Chat about Deno, a modern runtime for JavaScript and TypeScript.
20,934Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

In Deno, what is the best way to simply host static websites?
abcdef38Aabcdef38 / help
3y ago
Problems with Deno KV
mostprodevMmostprodev / help
3y ago
KV read count
wilsonlewisWwilsonlewis / help
3y ago
What is the best way to find the specific npm package available on Deno?
KeiKKei / help
2y ago