---
lang: en
title: 'API docs: repository.kvconnector.ttl'
keywords: LoopBack 4.0, LoopBack 4, Node.js, TypeScript, OpenAPI
sidebar: lb4_sidebar
editurl: https://github.com/strongloop/loopback-next/tree/master/packages/repository
permalink: /doc/en/lb4/apidocs.repository.kvconnector.ttl.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; [ttl](./repository.kvconnector.ttl.md)

## KVConnector.ttl() method

Get ttl for an entry by key

<b>Signature:</b>

```typescript
ttl?(modelClass: Class<Entity>, key: string, ttl: number, options?: Options): Promise<number>;
```

## 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 | Time to live in millisenconds |
|  options | [Options](./repository.options.md) | Options for the operation |

<b>Returns:</b>

Promise&lt;number&gt;

A promise of the TTL value


