0

I run the command sails generate model words.common It created in the model folder the model file Words.common.js

but I got a server error: The Words.common model has an invalid name. Model names must start with a letter and contain only letters, numbers and underscores.

MongoDB supports collection name with dots. How do I set it correctly in Sails? and how do I call this model from the controller?

I use Sails v1.0

Nati Y.
  • 31
  • 3

2 Answers2

2

I found a solution:

i run : sails generate model wordsCommon

In the model file I added after the attributes field : tableName: 'words.common'

In the controller, I get the model by WordsCommon global variable.

Nati Y.
  • 31
  • 3
0

Run This Comamnd: sails generate model userModal your modal name

shashwat
  • 11
  • 3