Skip to main content
Deno 2 is finally here 🎉️
Learn more
Go to Latest
function collectValues
import { collectValues } from "https://deno.land/x/netzo@0.2.94/plugins/portals/utils/db.ts";

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

Examples

Example 1

import { collectValues, listItems, type Item } from "netzo/plugins/portals/utils/db.ts";

const items = await collectValues<Item>(listItems());
items[0].id; // Returns "01H9YD2RVCYTBVJEYEJEV5D1S1";
items[0].userLogin; // Returns "snoop"
items[0].title; // Returns "example-title"
items[0].url; // Returns "http://example.com"
items[0].score; // Returns 420