why this code can run 1k data. I don't understand this part.
why this code can run 1k data.
I don't understand this part.
I don't understand this part.
list() returns at max 1k keys at a time. You can then paginate through it to get the rest
.invalid is promised to not exist, right?const ips = new Set();
let cursor = undefined;
while(true) {
const result = await env.KV.list({ cursor });
for(const { name } of result.keys) {
ips.add(await env.KV.get(name));
}
if(result.list_complete) {
break;
}
cursor = result.cursor;
}
console.log(Array.from(ips.values()));