Categories: Misc

How to destroy a strongloop model in loopback.io

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.

askfinance

Recent Posts

How to close Yes Bank account online?

Yes Bank, located in Mumbai, India, was formed in 2004 by Rana Kapoor and Ashok…

2 years ago

How to deposit cash in CDM?

While we are moving toward a cashless economy, we cannot entirely remove cash deposits. After…

2 years ago

How to register for IDBI net banking?

IDBI bank customers have access to Internet Banking. It allows them to access and manage…

2 years ago

How to fill SBI deposit slip?

The State Bank of India is one of the major public sector banks in India.…

2 years ago

How to close IndusInd Bank account?

IndusInd Bank Limited is a Mumbai-based Indian financial services company. Commercial, transactional, and electronic banking…

2 years ago

How to close Indian Bank account?

Indian Bank is a prominent nationalized bank. It is owned by the Government of India's…

2 years ago