ÓscarÓ
Deno3y 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() 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`);
Was this page helpful?