Skip to content

Commit 2037c17

Browse files
fix(migration): caching Keyv breaking change
1 parent 14cdd83 commit 2037c17

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

content/migration.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,8 @@ CacheModule.registerAsync({
187187

188188
Where `KeyvRedis` is imported from the `@keyv/redis` package. See the [Caching documentation](/techniques/caching) to learn more.
189189

190+
> warning **Warning** With this update, cached data managed by the Keyv library is now wrapped in an object with value and expires fields, e.g.: `{{ '{' }}"value": "yourData", "expires": 1678901234567{{ '}' }}`. While `Keyv` automatically extracts the `value` field when retrieving data through its API, this is a critical change to be aware of if you access cache data directly (e.g. outside the cache-manager API) or if you need to support data written with the previous version of `@nestjs/cache-manager`.
191+
190192
#### Config module
191193

192194
If you're using the `ConfigModule` from the `@nestjs/config` package, be aware of several breaking changes introduced in `@nestjs/[email protected]`. Most notably, the order in which configuration variables are read by the `ConfigService#get` method has been updated. The new order is:

content/techniques/caching.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,8 @@ In this example, we've registered two stores: `CacheableMemory` and `KeyvRedis`.
264264
265265
Check out the [Keyv documentation](https://keyv.org/docs/) for more information on available stores.
266266
267+
> warning **Warning** With this update, cached data managed by the Keyv library is now wrapped in an object with value and expires fields, e.g.: `{{ '{' }}"value": "yourData", "expires": 1678901234567{{ '}' }}`. While `Keyv` automatically extracts the `value` field when retrieving data through its API, this is a critical change to be aware of if you access cache data directly (e.g. outside the cache-manager API) or if you need to support data written with the previous version of `@nestjs/cache-manager`.
268+
267269
#### Async configuration
268270
269271
You may want to asynchronously pass in module options instead of passing them statically at compile time. In this case, use the `registerAsync()` method, which provides several ways to deal with async configuration.

0 commit comments

Comments
 (0)