In the code below the query gives me all the fields. I only want to query _id and serialno. How to go about it.
Schema
var DataSchema = new Schema({
serialno: String,
info: String,
active: Boolean,
content: String
});
Query
// Get list of datas
exports.index = function(req, res) {
Data.find(function (err, data) {
if(err) { return handleError(res, err); }
return res.json(200, data);
});
};