Created
November 30, 2018 16:56
-
-
Save diurivj/b9a29bd5fb0d57f3c6d767917cae01d5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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