You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> info **Hint** The `Cache` class is imported from the `cache-manager`, while `CACHE_MANAGER` token from the `@nestjs/common` package.
40
40
41
-
The `get` method on the `Cache` instance (from the `cache-manager` package) is used to retrieve items from the cache. If the item does not exist in the cache, an exception will be thrown.
41
+
The `get` method on the `Cache` instance (from the `cache-manager` package) is used to retrieve items from the cache. If the item does not exist in the cache, undefined will be returned.
42
42
43
43
```typescript
44
-
const value =this.cacheManager.get('key');
44
+
const value =awaitthis.cacheManager.get('key');
45
45
```
46
46
47
47
To add an item to the cache, use the `set` method:
0 commit comments