How do I compute a cursor for kv.list?
I basically I want to list entries after a known key. I'm trying to implement this function:
function getEvents(afterEventId: string) {
const entries = db.list({ prefix: ["events"] }, { cursor: ??? }
....
}
1 Reply
Hi @jeff, this guide maybe can help you with cursors:
https://deno-blog.com/A_Comprehensive_Guide_to_Deno_KV.2023-06-30#pagination-with-list
Craig's Deno Diary
Craig's Deno Diary is a blog covering the JavaScript and TypeScript runtime Deno.