Merge pull request #33190 from Sorosliu1029/ioredis

[ioredis] Fix mset and msetnx allowing object and string array
This commit is contained in:
Andrew Casey
2019-02-20 18:08:34 -08:00
committed by GitHub
2 changed files with 15 additions and 6 deletions
+12 -6
View File
@@ -272,7 +272,7 @@ declare namespace IORedis {
hgetBuffer(key: KeyType, field: string, callback: (err: Error, res: Buffer) => void): void;
hgetBuffer(key: KeyType, field: string): Promise<Buffer>;
hmset(key: KeyType, field: string, value: any, ...args: string[]): Promise<0 | 1>;
hmset(key: KeyType, ...args: any[]): Promise<0 | 1>;
hmset(key: KeyType, data: any, callback: (err: Error, res: 0 | 1) => void): void;
hmset(key: KeyType, data: any): Promise<0 | 1>;
@@ -313,9 +313,13 @@ declare namespace IORedis {
getset(key: KeyType, value: any, callback: (err: Error, res: string | null) => void): void;
getset(key: KeyType, value: any): Promise<string | null>;
mset(key: KeyType, value: any, ...args: string[]): any;
mset(...args: any[]): any;
mset(data: any, callback: (err: Error, res: string) => void): void;
mset(data: any): Promise<string>;
msetnx(key: KeyType, value: any, ...args: string[]): any;
msetnx(...args: any[]): any;
msetnx(data: any, callback: (err: Error, res: 0 | 1) => void): void;
msetnx(data: any): Promise<0 | 1>;
randomkey(callback: (err: Error, res: string) => void): void;
randomkey(): Promise<string>;
@@ -675,7 +679,7 @@ declare namespace IORedis {
hget(key: KeyType, field: string, callback?: (err: Error, res: string | string) => void): Pipeline;
hgetBuffer(key: KeyType, field: string, callback?: (err: Error, res: Buffer) => void): Pipeline;
hmset(key: KeyType, field: string, value: any, ...args: string[]): Pipeline;
hmset(key: KeyType, ...args: any[]): Pipeline;
hmset(key: KeyType, data: any, callback?: (err: Error, res: 0 | 1) => void): Pipeline;
hmget(key: KeyType, ...fields: string[]): Pipeline;
@@ -704,9 +708,11 @@ declare namespace IORedis {
getset(key: KeyType, value: any, callback?: (err: Error, res: string) => void): Pipeline;
mset(key: KeyType, value: any, ...args: string[]): Pipeline;
mset(...args: any[]): Pipeline;
mset(data: any, callback?: (err: Error, res: string) => void): Pipeline;
msetnx(key: KeyType, value: any, ...args: string[]): Pipeline;
msetnx(...args: any[]): Pipeline;
msetnx(data: any, callback?: (err: Error, res: 0 | 1) => void): Pipeline;
randomkey(callback?: (err: Error, res: string) => void): Pipeline;
+3
View File
@@ -154,6 +154,9 @@ redis.multi([
const keys = ['foo', 'bar'];
redis.mget(...keys);
redis.mset(...['foo', 'bar']);
redis.mset({ foo: 'bar' });
new Redis.Cluster([
'localhost'
]);