Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

184
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda