I'm creating a node.js REST API and i cannot query data in my API> here's the link to my code on github. Github line 150
And alo this is the code example
api.get('/story', function (req, res) {
Story.find({owner: req.decoded._id}, function (err, stories) {
if (err) {
res.send(err);
return
}
res.json(stories);
});
});
I want to find all the Stories creatd by logged user. o i send the user id in request. there are many posts done by user, but i'm getting a null array.