Using the code snippet below, I am able to retrieve all articles:
getAllPost: (req, res) => {
Article.find({}).limit().populate('author').then(articles => {
res.render('home/AllPost',{
articles
});
});
}
Is there a way to display only the articles belonging to the currently logged in user? I'm unsure of how to achieve this task.