Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/netzo/plugins/auth/utils/db.ts>collectValues

Full-stack Deno framework for building business web apps like internal tools, dashboards, admin panels and automated workflows.
Go to Latest
function collectValues
import { collectValues } from "https://deno.land/x/netzo@0.4.49/plugins/auth/utils/db.ts";

Returns an array of values of a given Deno.KvListIterator that's been iterated over.

Examples

Example 1

import { collectValues, listUsers, type User } from "../../../../auth/utils/db.ts";

const users = await collectValues<User>(listUsers());
users[0].id; // Returns "01H9YD2RVCYTBVJEYEJEV5D1S1";
users[0].authId; // Returns "auth0|xxx"
users[0].sessionId; // Returns "xxx"
users[0].name; // Returns "Snoop Dogg"
users[0].email; // Returns "snoop.dogg@example"
users[0].roles; // Returns ["admin"]
users[0].provider; // Returns "github"
users[0].createdAt; // Returns "2021-08-31T00:00:00.000Z"
users[0].updatedAt; // Returns "2021-08-31T00:00:00.000Z"