Skip to content

API Reference parrot.userstore.redis_documents

github-actions[bot] edited this page Dec 2, 2026 · 1 revision

parrot.userstore.redis_documents

View source

Keyed JSON documents with secondary indexes over redis.asyncio (FEAT-878).

Alias CollectionSpec

Re-exported from parrot.userstore.collections.CollectionSpec.

Class RedisDocumentStore

Keyed JSON documents for one CollectionSpec. Equality filters only; no TTL.

Parameter Type Default Description
spec CollectionSpec
client aioredis.Redis | None None
prefix str | None None

Attributes:

Attribute Type Description
client aioredis.Redis Return the injected client or the per-loop user-store client.

Method RedisDocumentStore.get

Return the document for the full key, or None.

get(key: Mapping[str, Any]) -> dict[str, Any] | None

Parameter Type Default Description
key Mapping[str, Any]

Returns: dict[str, Any] | None

Method RedisDocumentStore.exists

Return whether a document with the full key exists.

exists(key: Mapping[str, Any]) -> bool

Parameter Type Default Description
key Mapping[str, Any]

Returns: bool

Method RedisDocumentStore.put

Replace the whole document, taking its key from the document.

put(document: Mapping[str, Any]) -> None

Parameter Type Default Description
document Mapping[str, Any]

Method RedisDocumentStore.create

Insert only when absent and report whether a document was created.

create(document: Mapping[str, Any]) -> bool

Parameter Type Default Description
document Mapping[str, Any]

Returns: bool

Method RedisDocumentStore.upsert

Apply $set/$setOnInsert semantics and return the stored document.

upsert(key: Mapping[str, Any], set_fields: Mapping[str, Any], *, on_insert: Mapping[str, Any] | None = None) -> dict[str, Any]

Parameter Type Default Description
key Mapping[str, Any]
set_fields Mapping[str, Any]
on_insert Mapping[str, Any] | None None

Returns: dict[str, Any]

Method RedisDocumentStore.update

Merge fields into an existing document without creating one.

update(key: Mapping[str, Any], set_fields: Mapping[str, Any]) -> bool

Parameter Type Default Description
key Mapping[str, Any]
set_fields Mapping[str, Any]

Returns: bool

Method RedisDocumentStore.delete

Delete a document and return whether it was present.

delete(key: Mapping[str, Any]) -> bool

Parameter Type Default Description
key Mapping[str, Any]

Returns: bool

Method RedisDocumentStore.find

Return documents matching every equality filter in where.

find(where: Mapping[str, Any] | None = None) -> list[dict[str, Any]]

Parameter Type Default Description
where Mapping[str, Any] | None None

Returns: list[dict[str, Any]]

Method RedisDocumentStore.delete_where

Delete and return each document matching where.

delete_where(where: Mapping[str, Any]) -> list[dict[str, Any]]

Parameter Type Default Description
where Mapping[str, Any]

Returns: list[dict[str, Any]]

Method RedisDocumentStore.scan

Yield every document in encoded-id order, skipping stale index entries.

scan() -> AsyncIterator[dict[str, Any]]

Returns: AsyncIterator[dict[str, Any]]

Alias get_user_store_redis

Re-exported from parrot.userstore.settings.get_user_store_redis.

Alias key_prefix

Re-exported from parrot.userstore.settings.key_prefix.

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally