Skip to content

Instantly share code, notes, and snippets.

@diurivj
Created November 30, 2018 16:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save diurivj/b9a29bd5fb0d57f3c6d767917cae01d5 to your computer and use it in GitHub Desktop.
Save diurivj/b9a29bd5fb0d57f3c6d767917cae01d5 to your computer and use it in GitHub Desktop.
router.get('/carlos', (req, res, next) => {
Post.find().populate('creator').populate({
path:'comments',
populate:{
path:'author',
model:'User'
}
})
.then(posts => {
res.send(posts);
})
.catch(err => {
res.send(err);
})
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment