Rest
...args_2: GeoMember<unknown>[]Optional
opts: { Optional
count?: { Optional
any?: booleanOptional
withOptional
withOptional
withOptional
opts: { Optional
count?: { Optional
any?: booleanOptional
storeCreate a new redis client by providing the url and token
const redis = new Redis({
url: "<UPSTASH_REDIS_REST_URL>",
token: "<UPSTASH_REDIS_REST_TOKEN>",
});
Create a new redis client by providing a custom Requester
implementation
import { UpstashRequest, Requester, UpstashResponse, Redis } from "@upstash/redis"
const requester: Requester = {
request: <TResult>(req: UpstashRequest): Promise<UpstashResponse<TResult>> => {
// ...
}
}
const redis = new Redis(requester)
Same as hscan
but returns an AsyncIterator to allow iteration via for await
.
Optional
options: ScanCommandOptionsSame as scan
but returns an AsyncIterator to allow iteration via for await
.
Optional
options: ScanCommandOptionsSame as sscan
but returns an AsyncIterator to allow iteration via for await
.
Optional
options: ScanCommandOptionsSame as zscan
but returns an AsyncIterator to allow iteration via for await
.
Optional
options: ScanCommandOptionsStatic
fromCreate a new Upstash Redis instance from environment variables.
Use this to automatically load connection secrets from your environment variables. For instance when using the Vercel integration.
This tries to load UPSTASH_REDIS_REST_URL
and UPSTASH_REDIS_REST_TOKEN
from
your environment using process.env
.
Optional
config: Omit<RedisConfigNodejs, "url" | "token">Protected
addTechnically this is not private, we can hide it from intellisense by doing this
Rest
...sourceKeys: string[]Protected
clientProtected
enableOptional
cmdOpts: ScanCommandOptionsCreate a new transaction to allow executing multiple steps atomically.
All the commands in a transaction are serialized and executed sequentially. A request sent by another client will never be served in the middle of the execution of a Redis Transaction. This guarantees that the commands are executed as a single isolated operation.
Protected
Optional
optsOptional
opts: ScanCommandOptionsOptional
opts: ScriptFlushCommandOptionsOptional
opts: SetCommandOptionsOptional
opts: ScanCommandOptionsWrap a new middleware around the HTTP client.
Optional
opts: { Optional
nomkOptional
trim?: { Optional
limit?: numberRest
...args: [key: string, scoreMember: ScoreMember<TData>, ...scoreMemberPairs: ScoreMember<TData>[]] | [key: string, opts: ZAddCommandOptions | ZAddCommandOptionsWithIncr, ScoreMember<TData>, ...ScoreMember<TData>[]]Optional
opts: ZInterStoreCommandOptionsRest
...args: [key: string, min: number, max: number, opts?: ZRangeCommandOptions] | [key: string, min: `(${string}` | `[${string}` | "-" | "+", max: `(${string}` | `[${string}` | "-" | "+", opts: { Optional
opts: ScanCommandOptionsOptional
opts: ZUnionCommandOptionsOptional
opts: ZUnionStoreCommandOptions
Serverless redis client for upstash.