UNPKG

@loopback/docs

Version:
38 lines (24 loc) 1.16 kB
--- lang: en title: 'API docs: repository.entitycrudrepository.updatebyid' keywords: LoopBack 4.0, LoopBack 4 sidebar: lb4_sidebar permalink: /doc/en/lb4/apidocs.repository.entitycrudrepository.updatebyid.html --- <!-- Do not edit this file. It is automatically generated by API Documenter. --> [Home](./index.md) &gt; [@loopback/repository](./repository.md) &gt; [EntityCrudRepository](./repository.entitycrudrepository.md) &gt; [updateById](./repository.entitycrudrepository.updatebyid.md) ## EntityCrudRepository.updateById() method Update an entity by id with property/value pairs in the data object <b>Signature:</b> ```typescript updateById(id: ID, data: DataObject<T>, options?: Options): Promise<void>; ``` ## Parameters | Parameter | Type | Description | | --- | --- | --- | | id | <code>ID</code> | Value for the entity id | | data | <code>DataObject&lt;T&gt;</code> | Data attributes to be updated | | options | <code>Options</code> | Options for the operations | <b>Returns:</b> `Promise<void>` A promise that will be resolve if the operation succeeded or will be rejected if the entity was not found.