If using mongoose, this issue can be solved by using .lean() to get a json object (instead of a mongoose one):
dbName.find({}).lean()
// execute query
.exec(function(error, body) {
//Some code
});
More Related Contents:
- How to properly reuse connection to Mongodb across NodeJs application and modules
- Render basic HTML view?
- How to search in array of object in mongodb
- How do I remove documents using Node.js Mongoose?
- UnhandledPromiseRejectionWarning: MongooseServerSelectionError
- MongoDB select where in array of _id?
- How to get updated document back from the findOneAndUpdate method?
- Can I determine if a string is a MongoDB ObjectID?
- how express forming the img URL
- Using Express Handlebars and Angular JS
- Error: Can’t set headers after they are sent to the client
- SyntaxError: Unexpected token function – Async Await Nodejs
- How do you send images to node js with Axios?
- Mongoose difference between .save() and using update()
- Why cant I inline call to res.json?
- How do sessions work in Express.js with Node.js?
- Mongoose subdocuments vs nested schema
- How to close electron app via javascript?
- How to get data passed from a form in Express (Node.js)
- Create an ISO date object in javascript
- How do I stream response in express?
- Node.js mongodb driver async/await queries
- What does “res.render” do, and what does the html file look like?
- Unable to send numbers using res.send() using express with node
- How to decipher string in node js which is encrypted in crypto js in javascript
- How to convert a string to ObjectId in nodejs mongodb native driver?
- JavaScript NoSQL Injection prevention in MongoDB
- Node.js passing parameters to client via express render
- MongooseError: Model.findOne() no longer accepts a callback at Function
- Can’t get rid of header X-Powered-By:Express