List kv items using a partial key
Hey guys am trying to figure out kv and how to get stuffout of it
how do i get iteme that have the key ["repo_pkgjson",reponame]
example
returns
but this
returns an empty array , waht am i doing wrong?
5 Replies
Can you show the full code?
kv.list
returns an async iterator, not an array of entries. You want to do for await (const repo of repos) { ... }
with the result of the list operation.list returns a KvListIterator. You must await each entry.
https://deno.land/api@v1.35.3?unstable=&s=Deno.Kv&p=prototype.list
Thanks guys it worked
Better yet since Deno 1.38:
- in one step
- in two steps
And you can still access each of them before storing them. For instance if you just want the Value and not the KV Part Key nor the Versionstamp:
Thank you even more