> For the complete documentation index, see [llms.txt](https://quickredis.js.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://quickredis.js.org/overview/docs.md).

# Documentation

## Commands

* [add](https://app.gitbook.com/s/-MRHXTgQsV3EeQ6CzZ-K/overview/docs.md#add)
* [delete](https://app.gitbook.com/s/-MRHXTgQsV3EeQ6CzZ-K/overview/docs.md#delete)
* [get](https://app.gitbook.com/s/-MRHXTgQsV3EeQ6CzZ-K/overview/docs.md#get)
* [has](https://app.gitbook.com/s/-MRHXTgQsV3EeQ6CzZ-K/overview/docs.md#has)
* [set](https://app.gitbook.com/s/-MRHXTgQsV3EeQ6CzZ-K/overview/docs.md#set)
* [subtract](https://app.gitbook.com/s/-MRHXTgQsV3EeQ6CzZ-K/overview/docs.md#subtract)

{% hint style="info" %}
All commands work with dotted notation
{% endhint %}

## add(*key*, *number*) <a href="#add" id="add"></a>

This command adds a number to a key in the Redis database (if the key doesn't exist it will add from 0)

```javascript
client.add('foo', 500).then(console.log) // -> 500
```

## delete(*key*) <a href="#delete" id="delete"></a>

This command deletes a key from the Redis database (returns 0 if key doesn't exist, returns 1 if success)

```javascript
client.set('foo', 'bar').then(console.log) // -> 'bar'

client.delete('foo').then(console.log) // -> 1
```

## get(*key*) <a href="#get" id="get"></a>

This command returns the value of a key in the Redis database

```javascript
client.set('foo', 'bar').then(console.log) // -> 'bar'

client.get('foo').then(console.log) // -> bar
```

## has(*key*) <a href="#has" id="has"></a>

This command checks if a key exists in the Redis database

```javascript
client.set('foo', 'bar').then(console.log) // -> 'bar'

client.has('foo').then(console.log) // -> true
```

## set(*key*, *value*) <a href="#set" id="set"></a>

This command sets the value of a key in the Redis database

```javascript
client.set('foo', 'bar').then(console.log) // -> 'bar'
```

## subtract(*key*, *number*) <a href="#subtract" id="subtract"></a>

This command subtracts a number from a key in the Redis database (if the key doesn't exist it will subtract from 0)

```javascript
client.subtract('foo', 500).then(console.log) // -> -500
```
