You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-06 02:15:48 +03:00
feat: add support for vector sets (#2998)
* wip * improve the vadd api * resp3 tests * fix some tests * extract json helper functions in client package * use transformJsonReply * remove the CACHEABLE flag for all vector set commands currently, client side caching is not supported for vector set commands by the server * properly transform vinfo result * add resp3 test for vlinks * add more tests for vrandmember * fix vrem return types * fix vsetattr return type * fix vsim_withscores * implement vlinks_withscores * set minimum docker image version to 8 * align return types * add RAW variant for VEMB -> VEMB_RAW * use the new parseCommand api
This commit is contained in:
committed by
GitHub
parent
b52177752e
commit
c5b4f47975
@@ -662,3 +662,21 @@ export function transformStreamsMessagesReplyResp3(reply: UnwrapReply<StreamsMes
|
||||
return ret as unknown as MapReply<BlobStringReply, StreamMessagesReply>
|
||||
}
|
||||
}
|
||||
|
||||
export type RedisJSON = null | boolean | number | string | Date | Array<RedisJSON> | {
|
||||
[key: string]: RedisJSON;
|
||||
[key: number]: RedisJSON;
|
||||
};
|
||||
|
||||
export function transformRedisJsonArgument(json: RedisJSON): string {
|
||||
return JSON.stringify(json);
|
||||
}
|
||||
|
||||
export function transformRedisJsonReply(json: BlobStringReply): RedisJSON {
|
||||
const res = JSON.parse((json as unknown as UnwrapReply<typeof json>).toString());
|
||||
return res;
|
||||
}
|
||||
|
||||
export function transformRedisJsonNullReply(json: NullReply | BlobStringReply): NullReply | RedisJSON {
|
||||
return isNullReply(json) ? json : transformRedisJsonReply(json);
|
||||
}
|
||||
|
Reference in New Issue
Block a user