Skip to content
This page View Markdown Open in ChatGPT Open in Claude

Reset database cache

g.sys.cache.resetCacheDB calls the reset database cache system API from your code.

Database cache reset

Reset cache of database table/collection using global object 'g'.

1
2
3
await g.sys.cache.resetCacheDB({
    instance: "INSTANCE_NAME", database: 'DB_NAME', collection: "COLLECTION_NAME",
});

Multi-tenant

  • Name the tenant after the instance to reset the cache of that tenant of a multi-tenant instance only. Without a tenant, the cache of the table is reset for its structure database and every tenant.
await g.sys.cache.resetCacheDB({ instance: "crm::acme", database: "crm", collection: "customers" }); // the tenant acme
await g.sys.cache.resetCacheDB({ instance: "crm", database: "crm", collection: "customers" });       // the structure database and every tenant