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
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"
Parameters
iter: Deno.KvListIterator<T>