Property getIdOf is missing in type 'typeof' in loopback

·

1 min read

Loopback is a highly extensible open-source Node. js framework that can be used to build dynamic REST APIs. Loopback hands you the power to: Quickly create APIs. Connect your APIs to data sources such as relational databases, MongoDB, REST APIs, etc.

sometimes we face below error in our model class repository

Property getIdOf is missing in type typeof in loopback

repository.jpeg

While using DefaultCrudRepository our model class should extends from Entity class because A Model is a generic model class that does not necessarily has any unique identifier. Entity is a Model that has a unique id (a primary key)

loopback-model.jpeg

Here in line number 4 we just need to change Model to Entity to fix this issue