-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Labels
Description
Hi folks,
I noticed that when I declare the hSet
command, the return type seems to be Promise<string>
, however, the official Redis command docs here https://redis.io/commands/hset mention that the return type of the HSET
command is an Integer Reply.
I experimented with the hSet
command a bit and the return type seems to be effectively a number
, which matches the number of fields that were set and matches the docs above.
My question is: Should the declared return type be updated to match the actual return type, or could it be that I'm doing something wrong?
How to reproduce:
const value = await client.hSet('key', {'field1': 'value1'});
TypeScript infers value
being a string
Thanks beforehand! 🙏
Environment:
- TypeScript Version: 4.4.4
- Node.js Version: 16.12 | 17.0.1
- Redis Server Version: 6.2.6
- Node Redis Version: 4.0.0-rc3
- Platform: Mac OS 10.14.6