orm - Sails.js + Waterline: Many-to-Many through association -
i'm new sails.js (v0.10.5) , waterline orm. have 3 tables in database: users (id, name), roles(id, alias) , join table users_roles(user_id, role_id). it's important not change table names , field names in database. want policy entity join entity between user , role. here mapping code: //user.js module.exports = { tablename: 'users', autocreatedat: false, autoupdatedat: false, attributes: { id: { type: 'integer', required: true }, name: { type: 'string' }, roles: { collection: 'role', via: 'users', through: 'policy' }, } } //role.js module.exports = { tablename: "roles", autocreatedat: false, autoupdatedat: false, attributes: { id: { type: 'integer', required: true }, alias: { type: 'string...