MCPcopy Create free account
hub / github.com/mikro-orm/mikro-orm / clearCache

Method clearCache

packages/core/src/EntityManager.ts:3206–3208  ·  view source on GitHub ↗

* Clears result cache for given cache key. If we want to be able to call this method, * we need to set the cache key explicitly when storing the cache. * * ```ts * // set the cache key to 'book-cache-key', with expiration of 60s * const res = await em.find(Book, { ... }, { cache: ['bo

(cacheKey: string)

Source from the content-addressed store, hash-verified

3204 * ```
3205 */
3206 async clearCache(cacheKey: string) {
3207 await this.getContext().#resultCache.remove(cacheKey);
3208 }
3209
3210 /**
3211 * Returns the default schema of this EntityManager. Respects the context, so global EM will give you the contextual schema

Calls 2

getContextMethod · 0.95
removeMethod · 0.65

Tested by

no test coverage detected