Skip to content

Latest commit

 

History

History
38 lines (28 loc) · 902 Bytes

v5.md

File metadata and controls

38 lines (28 loc) · 902 Bytes

RESP3 Support

TODO

const client = createClient({
  RESP: 3
});
// by default
await client.hGetAll('key'); // Record<string, string>

await client.withTypeMapping({
  [TYPES.MAP]: Map
}).hGetAll('key'); // Map<string, string>

await client.withTypeMapping({
  [TYPES.MAP]: Map,
  [TYPES.BLOB_STRING]: Buffer
}).hGetAll('key'); // Map<string, Buffer>

Sentinel Support

TODO

multi.exec<'typed'> / multi.execTyped

We have introduced the ability to perform a "typed" MULTI/EXEC transaction. Rather than returning Array<ReplyUnion>, a transaction invoked with .exec<'typed'> will return types appropriate to the commands in the transaction where possible:

const multi = client.multi().ping();
await multi.exec(); // Array<ReplyUnion>
await multi.exec<'typed'>(); // [string]
await multi.execTyped(); // [string]