Try this solution:
app.get('/itesms', function(req, res) {
items.find({}, { _id: 0 }).toArray(function (err, array) {
res.send(array);
})
});
More Related Contents:
- Unable to delete data from mongoDB
- collection is not defined in mongodb
- How do I manage MongoDB connections in a Node.js web application?
- db.collection is not a function when using MongoClient v3.0
- Populate nested array in mongoose
- Cannot overwrite model once compiled Mongoose
- Why is it recommended not to close a MongoDB connection anywhere in Node.js code?
- Mongoose Schema hasn’t been registered for model
- TypeError: db.collection is not a function
- Stream from a mongodb cursor to Express response in node.js
- Mongoose duplicate key error with upsert
- MongoDB on with Docker “failed to connect to server [localhost:27017] on first connect “
- How to protect the password field in Mongoose/MongoDB so it won’t return in a query when I populate collections?
- How to get a callback on MongoDB collection.find()
- Mongoose, find, return specific properties
- How to use mongoose findOne
- Meteor Subscribe doesn’t update sort order of collection
- Model.find().toArray() claiming to not have .toArray() method
- Mongoose optional search query parameters?
- MongoError: connect ECONNREFUSED 127.0.0.1:27017
- Difference between MongoDB and Mongoose
- How can I save multiple documents concurrently in Mongoose/Node.js?
- Mocking database in node.js?
- How do I increment a Number value in Mongoose?
- How to reference another schema in my Mongoose schema?
- Mongoose findOneAndUpdate and runValidators not working
- Populate a mongoose model with a field that isn’t an id
- mongoose recursive populate
- MongoDB $lookup vs Mongoose populate
- Heroku app crashes after MongoDB updated to 3.0