Answer the question
In order to leave comments, you need to log in
Why does MongoDB output an array with an object instead of an object?
This query returns a slightly unexpected result.
app.get('/blog/:url', (req, res) => {
var db = req.db;
Post.find({ 'url': req.params.url }, 'title description image content category date url', function (error, post) {
if (error) { console.error(error); }
res.send(post)
})
})
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question