this will not work because I need to register the same ip address in multiple ways
this will not work because I need to register the same ip address in multiple ways
Set, which will collapse them into a single unique instanceSet, so that you then dedupe themlist() returns at max 1k keys at a time. You can then paginate through it to get the rest
SetSetlist()const { keys } = await env.KV.list();
const ips = new Set();
for(const { name } of keys) {
ips.add(await env.KV.get(name));
}
console.log(Array.from(ips.values()));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()));