-1
I am with the following problem, I am trying to return only some fields like "name" and "email" of my JSON object, because it alone has 23 attributes
exports.listarProfissionais = function(request, response) {
if (request.get("Authorization") == "test") {
ProfissionalSchema.find({}, function(erro, profissionais) {
if (erro)
response.json({"erro": "Erro ao listar os profissionais !"});
else {
response.json(profissionais); // ASSIM ELE RETORNA TODOS OS ATRIBUTOS
}
});
} else {
response.json({"erro": "profissional/listar -> Invalid access tokens"});
}
}
I would like to return only the attribute "name" and "email" for example, but I’m having extreme difficulty understanding the concept.
Shows your method that generates the json object "professionals"
– Jovani