You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-07 13:22:56 +03:00
wip
This commit is contained in:
37
docs/v5.md
Normal file
37
docs/v5.md
Normal file
@@ -0,0 +1,37 @@
|
||||
# RESP3 Support
|
||||
|
||||
```javascript
|
||||
const client = createClient({
|
||||
RESP: 3
|
||||
});
|
||||
|
||||
client.on('error', err => console.error(err));
|
||||
|
||||
await client.connect();
|
||||
|
||||
client.hGetAll('key'); // Record<string, string>
|
||||
|
||||
client.withFlags({
|
||||
[TYPES.MAP]: Map
|
||||
}).hGetAll('key'); // Map<string, string>
|
||||
|
||||
client.withFlags({
|
||||
[TYPES.MAP]: Map,
|
||||
[TYPES.BLOB_STRING]: Buffer
|
||||
}).hGetAll('key'); // Map<string, Buffer>
|
||||
```
|
||||
|
||||
# `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:
|
||||
|
||||
```javascript
|
||||
const multi = client.multi().ping();
|
||||
await multi.exec(); // Array<ReplyUnion>
|
||||
await multi.exec<'typed'>(); // [string]
|
||||
await multi.execTyped(); // [string]
|
||||
```
|
||||
|
||||
# Request & Reply Policies
|
||||
|
||||
see [here](../docs/clustering.md#command-routing).
|
Reference in New Issue
Block a user