You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-06 02:15:48 +03:00
@@ -155,6 +155,7 @@ import * as XRANGE from '../commands/XRANGE';
|
||||
import * as XREAD from '../commands/XREAD';
|
||||
import * as XREADGROUP from '../commands/XREADGROUP';
|
||||
import * as XREVRANGE from '../commands/XREVRANGE';
|
||||
import * as XSETID from '../commands/XSETID';
|
||||
import * as XTRIM from '../commands/XTRIM';
|
||||
import * as ZADD from '../commands/ZADD';
|
||||
import * as ZCARD from '../commands/ZCARD';
|
||||
@@ -508,6 +509,8 @@ export default {
|
||||
xReadGroup: XREADGROUP,
|
||||
XREVRANGE,
|
||||
xRevRange: XREVRANGE,
|
||||
XSETID,
|
||||
xSetId: XSETID,
|
||||
XTRIM,
|
||||
xTrim: XTRIM,
|
||||
ZADD,
|
||||
|
0
packages/client/lib/commands/XSETID.spec.ts
Normal file
0
packages/client/lib/commands/XSETID.spec.ts
Normal file
28
packages/client/lib/commands/XSETID.ts
Normal file
28
packages/client/lib/commands/XSETID.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import { RedisCommandArgument, RedisCommandArguments } from '.';
|
||||
|
||||
export const FIRST_KEY_INDEX = 1;
|
||||
|
||||
interface XSetIdOptions {
|
||||
ENTRIESADDED?: number;
|
||||
MAXDELETEDID?: RedisCommandArgument;
|
||||
}
|
||||
|
||||
export function transformArguments(
|
||||
key: RedisCommandArgument,
|
||||
lastId: RedisCommandArgument,
|
||||
options?: XSetIdOptions
|
||||
): RedisCommandArguments {
|
||||
const args = ['XSETID', key, lastId];
|
||||
|
||||
if (options?.ENTRIESADDED) {
|
||||
args.push('ENTRIESADDED', options.ENTRIESADDED.toString());
|
||||
}
|
||||
|
||||
if (options?.MAXDELETEDID) {
|
||||
args.push('MAXDELETEDID', options.MAXDELETEDID);
|
||||
}
|
||||
|
||||
return args;
|
||||
}
|
||||
|
||||
export declare function transformReply(): 'OK';
|
Reference in New Issue
Block a user