Skip to content

Commit be25137

Browse files
authored
feat: list kv store keys by collection of prefix (#688)
Add `collection` and `prefix` query params for listing key-value store keys based on https://github.com/apify/actor-whitepaper/blob/master/pages/KEY_VALUE_STORE_SCHEMA.md#api-implications Api docs: apify/apify-docs#1564 Api impl: apify/apify-core#20726
1 parent 5e78586 commit be25137

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/resource_clients/key_value_store.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ export class KeyValueStoreClient extends ResourceClient {
5555
ow.object.exactShape({
5656
limit: ow.optional.number,
5757
exclusiveStartKey: ow.optional.string,
58+
collection: ow.optional.string,
59+
prefix: ow.optional.string,
5860
}),
5961
);
6062

@@ -267,6 +269,8 @@ export interface KeyValueClientUpdateOptions {
267269
export interface KeyValueClientListKeysOptions {
268270
limit?: number;
269271
exclusiveStartKey?: string;
272+
collection?: string;
273+
prefix?: string;
270274
}
271275

272276
export interface KeyValueClientListKeysResult {

test/key_value_stores.test.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,8 @@ describe('Key-Value Store methods', () => {
129129
const query = {
130130
limit: 10,
131131
exclusiveStartKey: 'fromKey',
132+
collection: 'my-collection',
133+
prefix: 'my-prefix',
132134
};
133135

134136
const res = await client.keyValueStore(storeId).listKeys(query);

0 commit comments

Comments
 (0)