One to Many User Posts Population
Fullstack Social iOS NodeJS REST
In the last lesson, I showed everyone how to attach a User object to each Post. In this lesson, we'll go over how to populate this property with the actual user information, instead of just a raw id value. Finally, as we loop through posts inside of html we can print out the user object along with the date timestamps.

Comments (7)
romulusc
4 years ago
Introduction done! enjoying the new course so far. The introductory 7 lessons from my_journal_web_app helped a lot to quickly understand what I was doing here. I'm new to node.js and backend.
pdefilippi
4 years ago
Hey Bryan, I would imagine that if there was a way to turn on code-completion for properties and functions you would of done it already? Is that just something that is not possible with VS Code? or might have to be done manually? There is a bunch of info online that points to manually setting this up...
Brian Voong
4 years ago
pdefilippi
4 years ago
Fair enough. This is my first time messing with it. Like everything else, all in time.
Bobur Pakhriev
3 years ago
Hey Brian i did everything correct, but on my post the time and date aren't coming up. how can i fix it?
Setwork44
3 years ago
its not accepting my user: { model: 'user' } and has a problem with the word 'user', what did I do wrong?
Setwork44
3 years ago
problem fixed! it was a missing comma ?
Brian Voong
3 years ago
Malikov_Vladimir
3 years ago
Guys be careful sometimes you can get a string "const Post = require("../../models/Post")" in home.js file (at the top). I spent a lot of time to fix my app.
slicedavocado
3 years ago
Yep. The IDE seems to add it automatically.
gerkov77
3 years ago
Hey Brian, great stuff there! My problem is that VSCode is now an upgraded version and dbugging is not do simple anymore :(. Unlucky enough for me, it is now offering options I do not understand, when I hit that play button. -Attach by process ID..-Node.js (preview), -Add configuration. I choose Node.js but but didn't seem to work. Ploblem, is that whole thing sounds greek to me compared to Xcode debugging. What to choose here, and how to do it? On your video it looks so much simpler! Thanks in advance!
gerkov77
3 years ago
The Node.js option has also many sub-options, where to attach, which I do not understand. I tried to attach to "current file", but it did not run the program in debug -at least the web browser did not get signal from the app.
gerkov77
3 years ago
Ok, finally I choose Nod.js(preview) option, and from II added a configuration called "Launch Program". This seemed to solve it, and I can now debug the variables.
jisanson
3 years ago
Thanks for sharing this. I had the same challenge.
kmcginnis
2 years ago
Maybe there is a conflict with the name Post, I kept getting the error "Post.find" is not a function... so I had to rename to FeedPost and it worked correctly.
HELP & SUPPORT