Keyvalue store is iterable?


#1

i want to run a foreach loop on a key-value store. However I don’t see a way to get all the keys (or even the current key if it could be made iterable).

It looks like I have to create an index somewhere in order to be able to have a list of all the keys. Any chance of a
datastore.forEach() something like dataset.forEach(), or perhaps
datastore.getKeys(); //returns something like [key1,key2,key3,...]


#2

Hi jstanley,

the SDK does not provide helper methods for all the API endpoints of Apify, but you can use the apify-client package to do just that.

See the listKeys() function that maps the List keys API.

Best,
Ondra