1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-07 13:22:56 +03:00
Files
node-redis/docs/RESP3.md
Leibale Eidelman b4bb68d8ab V5 branch (#2491)
* wip

* Worked on phrasing etc for v5 doc changes.

* Removed quite repetition of 'Rather'

* Update v4-to-v5.md

* Update v4-to-v5.md

* Update v4-to-v5.md

* WIP

* WIP

* clean SET command

* some more commands, multi.exec<'typed'>

* "typed" multi

* WIP

* upgrade deps

* wip

* wip

* fix #2469

* wip

* npm update

* wip

* wip

* wip

* wip

* some tests

* tests.yml

* wip

* wip

* merge master into v5

* some more commands

* some more commands

* WIP

* Release client@2.0.0-next.1

---------

Co-authored-by: Simon Prickett <simon@redislabs.com>
2023-04-30 11:18:46 -04:00

1.4 KiB

RESP3 => JS Type Mappings:

  • Null (_) => null
  • Boolean (#) => boolean
  • Number (:) => number | string
  • Big Number (() => BigInt | string
  • Double (,) => number | string
  • Simple String (+) => string | Buffer
  • Blob String ($) => string | Buffer
  • Verbatim String (=) => string | Buffer | VerbatimString (TODO: VerbatimString typedoc link)
  • Simple Error (-) => ErrorReply
  • Blob Error (!) => ErrorReply
  • Array (*) => Array
  • Set (~) => Array | Set
  • Map (%) => object | Map | Array
  • Push (>) => Array => PubSub push/'push' event

NOTE: the first type is the default type

Map keys and Set members

When decoding Map to Map | object or Set to Set, keys/members of type "Simple String" or "Blob String" will be decoded as strings (ignoring flags) to allow lookup by type. If you need them as Buffers, make sure to decode Maps/Sets as Arrays.

Not Implemented

These parts of RESP3 are not yet implemented in Redis itself (at the time of writing), so are not yet implemented in the Node-Redis client either: