I have a model with name "aaa_bbb", I want to change the name to aaa-bbb, I would like to know how I can achieve that? Or can I just change the name directly in my model json file? Here is the my current model.json file.
{
"name": "aaa_bbb",
"base": "PersistedModel",
"idInjection": true,
"options": {
"validateUpsert": true
},
"properties": {
...
},
"acls": [],
"methods": []
}
Typically there are 3 steps:
1 - Change the model name in
server/model-config.js
2 - Change the model name in
common/models/aaa-bbb.json
:3 - Change the model name in `commmon/models/aaa-bbb.js:
...however, in your case
AaaBbb
doesn't change, so you do not need to perform step 3. LoopBack automatically removes the_
or-
from the model name and UpperCamelCases the model name during scaffolding. This means BOTHaaa_bbb
andaaa-bbb
would outputAaaBbb
.