Page Contents
Home > @loopback/repository > EntityCrudRepository > replaceById
EntityCrudRepository.replaceById() method
Replace an entity by id
Signature:
replaceById(id: ID, data: DataObject<T>, options?: Options): Promise<void>;
Parameters
| Parameter | Type | Description |
|---|---|---|
| id | ID | Value for the entity id |
| data | DataObject<T> | Data attributes to be replaced |
| options | Options | Options for the operations |
Returns:
Promise<void>
A promise that will be resolve if the operation succeeded or will be rejected if the entity was not found.