---
lang: en
title: 'API docs: repository.defaultkeyvaluerepository'
keywords: LoopBack 4.0, LoopBack 4
sidebar: lb4_sidebar
permalink: /doc/en/lb4/apidocs.repository.defaultkeyvaluerepository.html
---

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

[Home](./index.md) &gt; [@loopback/repository](./repository.md) &gt; [DefaultKeyValueRepository](./repository.defaultkeyvaluerepository.md)

## DefaultKeyValueRepository class

An implementation of KeyValueRepository based on loopback-datasource-juggler

<b>Signature:</b>

```typescript
export declare class DefaultKeyValueRepository<T extends Entity> implements KeyValueRepository<T> 
```

## Constructors

|  Constructor | Modifiers | Description |
|  --- | --- | --- |
|  [(constructor)(entityClass, ds)](./repository.defaultkeyvaluerepository.(constructor).md) |  | Construct a KeyValueRepository with a legacy DataSource |

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [kvModelClass](./repository.defaultkeyvaluerepository.kvmodelclass.md) |  | <code>typeof juggler.KeyValueModel</code> | A legacy KeyValueModel class |

## Methods

|  Method | Modifiers | Description |
|  --- | --- | --- |
|  [delete(key, options)](./repository.defaultkeyvaluerepository.delete.md) |  |  |
|  [deleteAll(options)](./repository.defaultkeyvaluerepository.deleteall.md) |  |  |
|  [expire(key, ttl, options)](./repository.defaultkeyvaluerepository.expire.md) |  |  |
|  [get(key, options)](./repository.defaultkeyvaluerepository.get.md) |  |  |
|  [keys(filter, options)](./repository.defaultkeyvaluerepository.keys.md) |  |  |
|  [set(key, value, options)](./repository.defaultkeyvaluerepository.set.md) |  |  |
|  [toEntity(modelData)](./repository.defaultkeyvaluerepository.toentity.md) |  |  |
|  [ttl(key, options)](./repository.defaultkeyvaluerepository.ttl.md) |  |  |


