Sign in
Log inSign up
Why am I not able to modify the variable returned by Mongoose query?

Why am I not able to modify the variable returned by Mongoose query?

Shankar K's photo
Shankar K
·Mar 9, 2016
Article.find({}).exec(function(err, articles) {
    articles.date = moment();
    return res.json({articles: articles});
});

The extra date property that i'm adding is not showing in response.

Hassle-free blogging platform that developers and teams love.
  • Docs by Hashnode
    New
  • Blogs
  • AI Markdown Editor
  • GraphQL APIs
  • Open source Starter-kit

© Hashnode 2024 — LinearBytes Inc.

Privacy PolicyTermsCode of Conduct