帆/水线填充不能在交界处工作?

当我尝试用另一个联结表(模型)填充联结表(模型)时,水线填充给了我一个空的集合。 我使用多对多的关系,如下所示:

https://github.com/balderdashy/waterline/issues/705#issuecomment-60945411

我正在使用mongolabs的sails-mongo适配器。

示例代码,

模型用户

/user.js module.exports = { schema: true, attributes: { id: { type: 'string', primaryKey: true, }, student: { type: 'string' }, vendor: { type: 'string' }, courses: { collection: 'vendorcourse', via: 'users', through: 'usercourse' }, coursesProvided: { collection: 'course', via: 'vendors', through: 'vendorcourse' } } }; 

示范课程

 /course.js module.exports = { attributes: { id: { type: 'string', primaryKey: true, autoIncrement: true }, name: { type: 'string', required: true }, description: { type: 'string' }, type: { type: 'string' }, vendors: { collection: 'User', via: 'courseProvided', through: 'vendorcourse' } } }; 

示范供应链

 module.exports = { tableName: 'vendorcourse', tables: ['user', 'course'], junctionTable: true, attributes: { id: { type: 'string', autoIncrement: true, primaryKey: true }, name: { type: 'string', required: true }, course: { columnName: 'course', type: 'string', foreignKey: true, references: 'course', on: 'id', via: 'vendors', groupBy: 'course', required: true }, vendor: { columnName: 'vendor', type: 'string', foreignKey: true, references: 'user', on: 'id', via: 'coursesProvided', groupBy: 'user', required: true }, users: { collection: 'user', via: 'courses', through: 'usercourse' } } }; 

模型用户课程

 /usercourse.js module.exports = { tableName: 'usercourse', tables: ['user', 'vendorcourse'], junctionTable: true, attributes: { id: { type: 'string', autoIncrement: true, primaryKey: true }, course: { columnName: 'course', type: 'string', foreignKey: true, references: 'vendorcourse', on: 'id', via: 'users', groupBy: 'vendorcourse', required: true }, user: { columnName: 'user', type: 'string', foreignKey: true, references: 'user', on: 'id', via: 'courses', groupBy: 'user', required: true } } }; 

当我做

 usercourse.find().populate('course').exec(function(error,result){ console.log(result); }); 

输出是

 [{ 'id': //some ID, 'course': [] // this is should be populated with the relative record from the vendorcourse model 'user' : //some ID }] 

课程领域应该包含来自vendorcourse模型的logging,但是我得到一个空集合[]。

当我这样做的时候,同样的命令就行

  usercourse.find().populate('user').exec(function(error,result){ console.log(result); }); 

产量如预期

  [{ 'id': //some ID, 'course': //some ID, 'user': [{ //relevent data }] }] 

我做错了吗? 还是帆/水线不支持从另一个交界点表填充