Documentation
The documentation for Quick Redis
Commands
add(key, number)
This command adds a number to a key in the Redis database (if the key doesn't exist it will add from 0)
client.add('foo', 500).then(console.log) // -> 500
delete(key)
This command deletes a key from the Redis database (returns 0 if key doesn't exist, returns 1 if success)
client.set('foo', 'bar').then(console.log) // -> 'bar'
client.delete('foo').then(console.log) // -> 1
get(key)
This command returns the value of a key in the Redis database
client.set('foo', 'bar').then(console.log) // -> 'bar'
client.get('foo').then(console.log) // -> bar
has(key)
This command checks if a key exists in the Redis database
client.set('foo', 'bar').then(console.log) // -> 'bar'
client.has('foo').then(console.log) // -> true
set(key, value)
This command sets the value of a key in the Redis database
client.set('foo', 'bar').then(console.log) // -> 'bar'
subtract(key, number)
This command subtracts a number from a key in the Redis database (if the key doesn't exist it will subtract from 0)
client.subtract('foo', 500).then(console.log) // -> -500
Last updated
Was this helpful?