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

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

[Home](./index.md) &gt; [@loopback/repository](./repository.md) &gt; [CrudConnector](./repository.crudconnector.md) &gt; [updateById](./repository.crudconnector.updatebyid.md)

## CrudConnector.updateById() method

Update an entity by id

<b>Signature:</b>

```typescript
updateById?<IdType>(modelClass: Class<Entity>, id: IdType, data: EntityData, options?: Options): Promise<boolean>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  modelClass | [Class](./repository.class.md)<!-- -->&lt;[Entity](./repository.entity.md)<!-- -->&gt; | The model class |
|  id | IdType | The entity id value |
|  data | [EntityData](./repository.entitydata.md) | The data attributes to be updated |
|  options | [Options](./repository.options.md) | <i>(Optional)</i> Options for the operation |

<b>Returns:</b>

Promise&lt;boolean&gt;

Promise<true> if an entity is updated for the id, otherwise Promise<false>


