class UpstashRedisStoreBaseStore<string, Uint8Array>Class that extends the BaseStore class to interact with an Upstash Redis database. It provides methods for getting, setting, and deleting data, as well as yielding keys from the database.
The Momento cache client.
The amount of keys to retrieve per batch when yielding keys.
Deletes multiple keys and their associated values from the Cassandra database.
Retrieves the values associated with an array of keys from the Cassandra database. It chunks requests for large numbers of keys to manage performance and Cassandra limitations.
Sets multiple key-value pairs in the Cassandra database. Each key-value pair is processed to ensure compatibility with Cassandra's storage requirements.
Yields keys from the Cassandra database optionally based on a prefix, based on the store's keyDelimiter. This method pages through results efficiently for large datasets.
The name of the serializable. Override to provide an alias or to preserve the serialized module name in minified environments.
Implemented as a static method to support loading logic.
const store = new UpstashRedisStore({
client: new Redis({
url: "your-upstash-redis-url",
token: "your-upstash-redis-token",
}),
});
await store.mset([
["message:id:0", "encoded-ai-message"],
["message:id:1", "encoded-human-message"],
]);
const retrievedMessages = await store.mget(["message:id:0", "message:id:1"]);
const yieldedKeys = [];
for await (const key of store.yieldKeys("message:id")) {
yieldedKeys.push(key);
}
await store.mdelete(yieldedKeys);