【发布时间】:2021-06-24 14:41:27
【问题描述】:
我目前正在使用 NestJS 的缓存管理器模块,我想知道为什么我不能像这样获得 NodeRedis 客户端:
constructor(
@Inject(CACHE_MANAGER) private cacheManager: Cache,
) {
cacheManager.store.getClient();
}
我收到此错误:
ERROR in [...].controller.ts:24:24
TS2339: Property 'getClient' does not exist on type 'Store'.
22 | @Inject(CACHE_MANAGER) private cacheManager: Cache,
23 | ) {
> 24 | cacheManager.store.getClient();
| ^^^^^^^^^
25 | }
我在注册 CacheModule 时确实配置了 cache-manager-redis-store,然后我想我可以获取客户端。
【问题讨论】:
标签: nestjs node-redis cachemanager