From ca8f7876d26042dc2f4b1abe43188544d237e90b Mon Sep 17 00:00:00 2001 From: TJ Zhang Date: Fri, 9 Aug 2024 12:07:34 -0700 Subject: [PATCH] addressing comments Signed-off-by: TJ Zhang --- node/src/BaseClient.ts | 5 ++++- node/src/Commands.ts | 2 +- node/src/Transaction.ts | 3 +++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/node/src/BaseClient.ts b/node/src/BaseClient.ts index 4632fe929e..1b2ecfb61e 100644 --- a/node/src/BaseClient.ts +++ b/node/src/BaseClient.ts @@ -845,6 +845,7 @@ export class BaseClient { /** * Get the value of `key` and optionally set its expiration. `GETEX` is similar to {@link get} + * * See https://valkey.io/commands/getex for more details. * * @param key - The key to retrieve from the database. @@ -853,13 +854,15 @@ export class BaseClient { * Otherwise, a {@link TimeUnit} and duration of the expire time should be specified. * @returns If `key` exists, returns the value of `key` as a `string`. Otherwise, return `null`. * + * since - Valkey 6.2.0 and above. + * * @example * ```typescript * const result = await client.getex("key", {expiry: { type: "seconds", count: 5 }}); * console.log(result); // Output: 'value' * ``` */ - public getex( + public async getex( key: string, options?: "persist" | { unit: TimeUnit; duration: number }, ): Promise { diff --git a/node/src/Commands.ts b/node/src/Commands.ts index fb040c8dcc..8b16d4922d 100644 --- a/node/src/Commands.ts +++ b/node/src/Commands.ts @@ -3519,7 +3519,7 @@ export enum TimeUnit { * @internal */ export function createGetEx( - key: BulkString, + key: string, options?: "persist" | { unit: TimeUnit; duration: number }, ): command_request.Command { const args = [key]; diff --git a/node/src/Transaction.ts b/node/src/Transaction.ts index 7aaa10f8ff..141b1af69a 100644 --- a/node/src/Transaction.ts +++ b/node/src/Transaction.ts @@ -287,6 +287,7 @@ export class BaseTransaction> { } /** Get the value associated with the given key, or null if no such value exists. + * * See https://valkey.io/commands/get/ for details. * * @param key - The key to retrieve from the database. @@ -306,6 +307,8 @@ export class BaseTransaction> { * "persist" will retain the time to live associated with the key. Equivalent to `PERSIST` in the VALKEY API. * Otherwise, a {@link TimeUnit} and duration of the expire time should be specified. * + * since - Valkey 6.2.0 and above. + * * Command Response - If `key` exists, returns the value of `key` as a `string`. Otherwise, return `null`. */ public getex(