Closed
Description
.QUIT()
/.quit()
documentation states that the value returned by the command is 'OK'
which is probably assumed to be coming directly from redis as stated in Redis QUIT docs
when running the following code, quit returns undefined
, not 'OK'
it is either a bug in the code or a bug in the docs.
Welcome to Node.js v16.15.1.
Type ".help" for more information.
> const {createClient} = require('redis')
undefined
> const opt = {socket: {host:'redis', port: 6379}}
undefined
> let R = createClient(opt)
undefined
> R.connect().then(console.log)
Promise {
<pending>,
[Symbol(async_id_symbol)]: 63,
[Symbol(trigger_async_id_symbol)]: 53,
[Symbol(destroyed)]: { destroyed: false }
}
> undefined
R.sendCommand(['CLIENT', 'LIST']).then(console.log)
Promise {
<pending>,
[Symbol(async_id_symbol)]: 80,
[Symbol(trigger_async_id_symbol)]: 78,
[Symbol(destroyed)]: { destroyed: false }
}
> id=5 addr=172.18.0.2:53058 laddr=172.18.0.3:6379 fd=8 name= age=10 idle=0 flags=N db=0 sub=0 psub=0 multi=-1 qbuf=26 qbuf-free=40928 argv-mem=10 obl=0 oll=0 omem=0 tot-mem=61466 events=r cmd=client user=default redir=-1
R.quit().then(console.log)
Promise {
<pending>,
[Symbol(async_id_symbol)]: 103,
[Symbol(trigger_async_id_symbol)]: 91,
[Symbol(destroyed)]: { destroyed: false }
}
> undefined <==================== this should be 'OK', not undefined
Environment:
- Node.js Version: Node.js v16.15.1.
- Redis Server Version: Redis version=6.2.6, bits=64
- Node Redis Version: [email protected]
- Platform: Debian GNU/Linux 10 (buster) (docker)