Hello I'm really new in Sails and Nodejs,
Im using mysql as a DB.
I got this error
var schemaAttributes = this.waterline.schema[this.identity].attributes;
TypeError: Cannot read property 'schema' of undefined
and I tried reinstalling the module (Waterline), reinstalling Sails and it still not working.
This is my adapter:
module.exports.adapters = {
'default': 'mysql',
disk: {
module: 'sails-disk'
},
mysql: {
module: 'sails-mysql',
host: 'localhost',
user: 'root',
port: '3306',
password: '**********',
database: '**********'
}
};
You're trying to access what are essentially private APIs, so it's not surprising that you're not getting the results you want. If you want to get the list of attributes of a model, simply do:
Model.attributes
or, if you need to determine the model name at runtime:
sails.models[modelName].attributes