UNPKG

@loopback/docs

Version:

Documentation files rendered at [https://loopback.io](https://loopback.io)

40 lines (26 loc) 1.24 kB
--- lang: en title: 'API docs: repository.kvconnector.expire' keywords: LoopBack 4.0, LoopBack 4, Node.js, TypeScript, OpenAPI sidebar: lb4_sidebar editurl: https://github.com/loopbackio/loopback-next/tree/master/packages/repository permalink: /doc/en/lb4/apidocs.repository.kvconnector.expire.html --- <!-- Do not edit this file. It is automatically generated by API Documenter. --> [Home](./index.md) &gt; [@loopback/repository](./repository.md) &gt; [KVConnector](./repository.kvconnector.md) &gt; [expire](./repository.kvconnector.expire.md) ## KVConnector.expire() method Set up ttl for an entry by key **Signature:** ```typescript expire(modelClass: Class<Entity>, key: string, ttl: number, options?: Options): Promise<boolean>; ``` ## Parameters | Parameter | Type | Description | | --- | --- | --- | | modelClass | [Class](./repository.class.md)<!-- -->&lt;[Entity](./repository.entity.md)<!-- -->&gt; | Model class | | key | string | Key for the entry | | ttl | number | | | options | [Options](./repository.options.md) | _(Optional)_ Options for the operation | **Returns:** Promise&lt;boolean&gt; Promise<true> if an entry is configured for the key, otherwise Promise<false>