Sunday, December 30, 2018

javascript - How do I write the result from res.json to a proper json file using node.js?

This is the code snippet. The query returns in json form but how do I write these values in a JSON file?



app.get('/users', function(req, res) {
User.find({}, function(err, docs) {

res.json(docs);

console.error(err);
})
});

No comments:

Post a Comment

plot explanation - Why did Peaches' mom hang on the tree? - Movies & TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...