Skip to main content

KeyValueStoreClient

Sub-client for manipulating a single key-value store.

Index

Methods

delete

  • delete(): None

delete_record

  • delete_record(key): None

get

  • get(): dict | None

get_record

  • get_record(key, *, as_bytes, as_file): dict | None
  • Retrieve the given record from the key-value store.

    https://docs.apify.com/api/v2#/reference/key-value-stores/record/get-record


    Parameters

    • key: str

      Key of the record to retrieve.

    • optionalkeyword-onlyas_bytes: bool = False

      Deprecated, use get_record_as_bytes() instead. Whether to retrieve the record as raw bytes, default False.

    • optionalkeyword-onlyas_file: bool = False

      Deprecated, use stream_record() instead. Whether to retrieve the record as a file-like object, default False.

    Returns dict | None

get_record_as_bytes

  • get_record_as_bytes(key): dict | None

list_keys

  • list_keys(*, limit, exclusive_start_key, collection, prefix): dict

  • Parameters

    • optionalkeyword-onlylimit: int | None = None

      Number of keys to be returned. Maximum value is 1000.

    • optionalkeyword-onlyexclusive_start_key: str | None = None

      All keys up to this one (including) are skipped from the result.

    • optionalkeyword-onlycollection: str | None = None

      The name of the collection in store schema to list keys from.

    • optionalkeyword-onlyprefix: str | None = None

      The prefix of the keys to be listed.

    Returns dict

set_record

  • set_record(key, value, content_type): None

stream_record

  • stream_record(key): Iterator[dict | None]

update

  • update(*, name, general_access): dict