Skip to content

Commit 702c12b

Browse files
committed
feat(command): added command GETDEL supports
1 parent ebffbd6 commit 702c12b

File tree

3 files changed

+32
-0
lines changed

3 files changed

+32
-0
lines changed

CHANGES.md

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
- feat(command): added command `HRANDFILED` supports.
66
- feat(command): added `count` param of command `R/LPOP`.
77
- feat(command): added command `GETEX` supports.
8+
- feat(command): added command `GETDEL` supports.
89

910
## v1.2.3
1011

src/lib/Commands.ts

+17
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,23 @@ export const COMMANDS: Record<keyof C.ICommandAPIs, ICommand> = {
274274
prepare: createDefaultPreparer('GET'),
275275
},
276276

277+
/**
278+
* Command: getdel
279+
* @see https://redis.io/commands/getdel
280+
*/
281+
'getAndDel': {
282+
prepare: createDefaultPreparer('GETDEL'),
283+
process: U.nullableBuffer2String
284+
},
285+
286+
/**
287+
* Command: getdel
288+
* @see https://redis.io/commands/getdel
289+
*/
290+
'getAndDel$': {
291+
prepare: createDefaultPreparer('GETDEL'),
292+
},
293+
277294
/**
278295
* Command: getex
279296
* @see https://redis.io/commands/getex

src/lib/Common.ts

+14
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,20 @@ export interface ICommandAPIs {
260260
*/
261261
get$(key: string): Promise<Buffer | null>;
262262

263+
/**
264+
* Command: getdel
265+
* @see https://redis.io/commands/getdel
266+
* @since v6.2.0
267+
*/
268+
getAndDel(key: string): Promise<string | null>;
269+
270+
/**
271+
* Command: getdel
272+
* @see https://redis.io/commands/getdel
273+
* @since v6.2.0
274+
*/
275+
getAndDel$(key: string): Promise<Buffer | null>;
276+
263277
/**
264278
* Command: getex
265279
* @see https://redis.io/commands/getex

0 commit comments

Comments
 (0)