HIncrByCommand (commands/hincrby.ts)

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

Increment a hash field in Redis and return the new value.

// 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/hincrby
 * @see node_modules/@upstash/redis/docs/commands/hash/hincrby.mdx
 */
export class HIncrByCommand extends Command<number, number> {
  constructor(
    cmd: [key: string, field: string, increment: number],
    opts?: CommandOptions<number, number>
  ) {
    super(["hincrby", ...cmd], opts);
  }
}

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

Get a free API key