---
lang: en
title: 'API docs: repository.keyvaluerepository.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.keyvaluerepository.expire.html
---

<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@loopback/repository](./repository.md) &gt; [KeyValueRepository](./repository.keyvaluerepository.md) &gt; [expire](./repository.keyvaluerepository.expire.md)

## KeyValueRepository.expire() method

Set up ttl for an entry by key

<b>Signature:</b>

```typescript
expire(key: string, ttl: number, options?: Options): Promise<void>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  key | string | Key for the entry |
|  ttl | number | Ttl for the entry |
|  options | [Options](./repository.options.md) | <i>(Optional)</i> Options for the operation |

<b>Returns:</b>

Promise&lt;void&gt;


