You have to list the `code`s first, and then get the IPs from there
You have to list the
codes first, and then get the IPs from thereSet, 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
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()));