REDIS provides the EXISTS command that returns a boolean.
ioredis' exists() command returns a method. I have tried using a callback also to no avail.
I can see in the commands page that ofcourse this command is supported but how to use this?
Just check out the example: https://github.com/luin/ioredis/blob/master/examples/basic_operations.js
The example doesn't mention the Redis command "EXISTS".
@enst There're hundreds of Redis commands available, we just can't mention all of them. However, the usages of them are similar.
@luin calling exists in a for loop, the result in callback or promise is only boolean, but how to find which key is or not exist?? Will this supply a sync way?
redis.exists('myKey').then( exists => { console.log('Does it exist?', (exists === 1)) }