@databases/cache@1.1.0
New Features
-
Added
Cache.deletePrefix(prefix)
. This lets you delete all keys with a given prefix from the cache.deletePrefix
will throw an error if any of the keys are not serialized to a string. They can either already be strings, or you can usemapKey
to convert them into strings if you want to use this method. (#317)Using this method with replication enabled will result in this new type of replication event:
interface ReplicationDeletePrefixEvent { readonly kind: 'DELETE_PREFIX'; readonly name: string; readonly prefix: string; }
-
You can now pass multiple keys to
Cache.delete(...keys)
to more efficiently delete multiple keys in a single call. (#317)Passing multiple keys with replication enabled will result in this new type of replication event:
interface ReplicationDeleteMultipleEvent { readonly kind: 'DELETE_MULTIPLE'; readonly name: string; readonly keys: unknown[]; }
Bug Fixes
- Provide slightly stricter types for TypeScript (#318)