Build an application with MongoDB and NodeJS as backend-server. Fetched some companies
details from database according to their category id
, the problem is that the information is not displayed on both postman and ionic project, when called this API.
What to do to resolve this problem?
Sample code:
function filtrarPorCategoria(busqueda, regex) {
return new Promise((resolve, reject) => {
Empresa.find({ categoria: busqueda }, 'nombre estado').exec((err, empresas) => {
if (err) {
reject('Error al cargar las empresas', err);
} else {
console.log(empresas);
resolve(empresas);
}
});
});
}