This returns the proper amount of records, but, account is only populated in the first record. The query waterline produces is also correct and returns all the associated data for every record. populateAll()
has no effect. Swapping .then
for .exec
has no effect.
Additionally, the one "account" that does show up as an association isn't even the right record.
Am I doing something wrong or is this a bug?
mail_items.find().populate('account').then(function(mail_items) {
return mail_items;
});
accounts.js
module.exports = {
tableName : 'accounts',
attributes : {
account_id : {
type : 'int',
primaryKey : true,
unique : true
},
name : 'string'
}
};
mail_items.js
module.exports = {
tableName : 'mail_items',
attributes : {
mail_item_id : {
type : 'int',
primaryKey : true,
unique : true
},
sender : 'string',
account : {
columnName : 'account_id',
type : 'int',
model : 'accounts'
}
}
};