MGetCommand (commands/mget.ts)

redis-js · packages/redis/pkg/commands/mget.ts · typescript · MIT
database

Enables fetching multiple Redis keys via the MGET command.

// Source: https://github.com/upstash/redis-js | License: MIT | Copyright 2021 Upstash, Inc
// Provided via justclaw.it.com; keep this notice with the code.
import type { CommandOptions } from "./command";
import { Command } from "./command";
/**
 * @see https://redis.io/commands/mget
 * @see node_modules/@upstash/redis/docs/commands/string/mget.mdx
 * Responses are JSON-parsed automatically: a stored "123" comes back as the number 123, "true" as
 * true, and '{"a":1}' as an object. Pass automaticDeserialization: false to the Redis constructor
 * to receive raw strings.
 */
export class MGetCommand<TData extends unknown[]> extends Command<(string | null)[], TData> {
  constructor(cmd: [string[]] | [...string[]], opts?: CommandOptions<(string | null)[], TData>) {
    const keys = Array.isAr

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key