Page Contents
Home > @loopback/repository > CrudConnector > findById
CrudConnector.findById() method
Find an entity by id
Signature:
findById?<IdType>(modelClass: Class<Entity>, id: IdType, options?: Options): Promise<EntityData>;
Parameters
| Parameter | Type | Description |
|---|---|---|
| modelClass | Class<Entity> | The model class |
| id | IdType | The entity id value |
| options | Options | Options for the operation |
Returns:
Promise<EntityData>
A promise of the entity found for the id