Skip to main content

Command Palette

Search for a command to run...

Property getIdOf is missing in type 'typeof' in loopback

Updated
1 min read
A

Self taught developer working on Angular, Vue, Typescript, Node JS, MongoDB, Express JS, LoopBack API, Laravel, Laravel Lumen, mysql. write packages for angular/vue. Part time youtuber

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

More from this blog

Angular, TypeScript, Vue, Node JS, Express JS, MongoDB, MongoDB Cloud, PHP, Laravel, Slim Framework, Mysql, JavaScript, PWA

24 posts

I'm a Full Stack Developer, Open Source Contributor, Blogger, npm packages developer, Youtuber. My hobbies are Contribution in open source projects, blogging, develop npm packages, part time youtuber