How to destroy a strongloop model in loopback.io

May 17th, 2017 , , Leave a comment

Last updated on May 17th, 2017 at 09:39 pm

Questions : How to destroy Model in loopback.io?

Answer : We can delete loopback model by using following command

slc persistedModel.destroy()

But After executing this, you might get the following error
slc persistedModel.destroy() : command not found error.

If you get the error then follow these steps 

Step 1 :
Delete /common/models/your-model.js

Step 2 :
Delete /common/models/your-model.json 

Step 3 :
Delete the lines referencing your model in /server/model-config.json.
Also, delete references of relation in other models if relation created.

Leave a Reply

Be the First to Comment!

Notify of
avatar
wpDiscuz