Page Contents

Home > @loopback/repository > EntityCrudRepository > findById

EntityCrudRepository.findById() method

Find an entity by id, return a rejected promise if not found.


findById(id: ID, filter?: Filter<T>, options?: Options): Promise<T & Relations>;


Parameter Type Description
id ID Value for the entity id
filter Filter<T> Additional query options. E.g. filter.include configures which related models to fetch as part of the database query (or queries).
options Options Options for the operations


Promise<T & Relations>

A promise of an entity found for the id