@loopback/docs
Version:
Documentation for LoopBack 4
39 lines (25 loc) • 1.07 kB
Markdown
---
lang: en
title: 'API docs: repository.kvconnector.set'
keywords: LoopBack 4.0, LoopBack 4
sidebar: lb4_sidebar
permalink: /doc/en/lb4/apidocs.repository.kvconnector.set.html
---
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@loopback/repository](./repository.md) > [KVConnector](./repository.kvconnector.md) > [set](./repository.kvconnector.set.md)
## KVConnector.set() method
Set an entry with key/value
<b>Signature:</b>
```typescript
set(modelClass: Class<Entity>, key: string, value: EntityData, options?: Options): Promise<boolean>;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| modelClass | <code>Class<Entity></code> | Model class |
| key | <code>string</code> | Key for the entry |
| value | <code>EntityData</code> | Value for the entry |
| options | <code>Options</code> | Options for the operation |
<b>Returns:</b>
`Promise<boolean>`
Promise<true> if an entry is set for the key, otherwise Promise<false>