Skip to content

Commit

Permalink
docs(README): Avoid ambiguity in the unit of EX flags
Browse files Browse the repository at this point in the history
Closes #1736
  • Loading branch information
luin committed May 19, 2023
1 parent 7096a10 commit ea8a006
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -304,11 +304,11 @@ listenForMessage();

## Expiration

Redis can set a timeout to expire your key, after the timeout has expired the key will be automatically deleted. (You can find the [official Expire documentation](https://redis.io/commands/expire/) to understand better the different parameters you can use), to set your key to expire in 1000 seconds, we will have the following code:
Redis can set a timeout to expire your key, after the timeout has expired the key will be automatically deleted. (You can find the [official Expire documentation](https://redis.io/commands/expire/) to understand better the different parameters you can use), to set your key to expire in 60 seconds, we will have the following code:

```javascript
redis.set("key", "data", "EX", 1000);
// Equivalent to redis command "SET key data EX 1000", because on ioredis set method,
redis.set("key", "data", "EX", 60);
// Equivalent to redis command "SET key data EX 60", because on ioredis set method,
// all arguments are passed directly to the redis server.
```

Expand Down Expand Up @@ -898,8 +898,8 @@ If you do not want to use a connection string, you can also specify an empty `tl

```javascript
const redis = new Redis({
host: 'redis.my-service.com',
tls: {}
host: "redis.my-service.com",
tls: {},
});
```

Expand Down

0 comments on commit ea8a006

Please sign in to comment.