Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

183
Vistas
How to Count Number of Data in MongoDB and Display to EJS

I get an output when I'm displaying it through the console.log, but when I try to display it through ejs I get no output. Is there any way I can display my .countDocument() result through ejs?

Here's my code:

const getDocument = async() => {
    try{
        const result = await Contact
        //to count only the services 
        .find({$or: [{subject:"Land Surveying"} , {subject:"Construction"} , {subject:"Consultation and Planning"} , {subject: "Architecture"}]})
        .countDocuments();
        console.log(result);
    }catch(err){
        console.log(err);
    }
}
getDocument();
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda