@loopback/docs
Version:
Documentation files rendered at [https://loopback.io](https://loopback.io)
38 lines (24 loc) • 1.01 kB
Markdown
lang: en
title: 'API docs: repository.keyvaluerepository.ttl'
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.ttl.html
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@loopback/repository](./repository.md) > [KeyValueRepository](./repository.keyvaluerepository.md) > [ttl](./repository.keyvaluerepository.ttl.md)
## KeyValueRepository.ttl() method
Get ttl for an entry by key
<b>Signature:</b>
```typescript
ttl?(key: string, options?: Options): Promise<number>;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| key | string | Key for the entry |
| options | [Options](./repository.options.md) | Options for the operation |
<b>Returns:</b>
Promise<number>
A promise of the TTL value