Page Contents

Home > @loopback/repository > EntityCrudRepository > updateById

EntityCrudRepository.updateById() method

Update an entity by id with property/value pairs in the data object

Signature:

updateById(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 updated
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.