Skip to content

Commit 0864142

Browse files
Merge pull request #2509 from nibble2/fix-caching-docs
docs(caching): fix cacheManager.set, get property
2 parents 931f4a7 + 7d37346 commit 0864142

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

content/techniques/caching.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,13 @@ The default expiration time of the cache is 5 seconds.
5454
You can manually specify a TTL (expiration time in seconds) for this specific key, as follows:
5555

5656
```typescript
57-
await this.cacheManager.set('key', 'value', { ttl: 1000 });
57+
await this.cacheManager.set('key', 'value', 1000);
5858
```
5959

6060
To disable expiration of the cache, set the `ttl` configuration property to `0`:
6161

6262
```typescript
63-
await this.cacheManager.set('key', 'value', { ttl: 0 });
63+
await this.cacheManager.set('key', 'value', 0);
6464
```
6565

6666
To remove an item from the cache, use the `del` method:

0 commit comments

Comments
 (0)