Sails.js .10 rc8
I've completely run out of ideas for this
I have a model called User and I want to associate it in a collection to other users like a friends list. Like a many-to-many association
//User.js
friends: {
collection: 'user',
via: 'friends'
}
.populate('friends')
Your models should look like this...
//User.js
friends: {
collection: 'friend',
via: 'user'
}
//Friend.js
user: {
model: 'user'
via: 'friends'
}
Also sails 10 rc8 is old. You should be on sails 10.5