Follow Users with Association Collection
Fullstack Social iOS NodeJS REST
Now that we have our navigation system built out and our users being displayed, we'll move onto performing the follow functionality. Doing this is quite easy with the power of our Vue framework and functions in our methods block. On the server side of things, we'll add to a 'following' collection through association using User.addToCollection(...). Once we've followed a user, I'll show you how to populate our collection called "following" and display it in raw JSON with a /profile route.

Comments (3)
Dustin Doosun Yang
4 years ago
Question: Why the following block does not shows following attribute for each user? How come it shows only 3 attributes(except the following) when we change the customToJson() { ... "following": [ { "id": "5d4727b479c8c511a1bcf511", "fullName": "iPhone user", "emailAddress": "test3@gmail.com" } ] }
Brian Voong
4 years ago
Dustin Doosun Yang
4 years ago
Thanks Brian
David EJ
3 years ago
Hi Brian, What it's difference between addTocollection() and relationship like oneToMany ? Thx
Brian Voong
3 years ago
Brian Voong
3 years ago
omq78
3 years ago
hi brian any tips about two dimensional relation between users not like following it's more like adding friends like facebook, or linked in when you add a user as a friend both will see each other posts and send messages as friends thanks
HELP & SUPPORT