I want to call all the names of a 'users' collection without the information that accompanies it, the query that I do brings all the information that is in the 'users' collection (name, surname, password) and I would just like to call the names excluding surname and password, is it possible?
router.get('/getusers',getTypeUser, (req,res) => {
const Users = require('../models/users');
Users.find({typeuser:res.typeUser}).exec(function(err, Users ){
if(err){
console.log("Error");
}else{
res.json(Users);
}
})
})