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

210
Visualizações
i can't get student result by roll number from mongodb roll number send from ejs form

** help me it's not working. ejs form for sending student roll number to MongoDB fetch individual student result by roll number**

<section>
    <div>
        <form action="/result">
            <label for="rollno">your Roll Number</label>
            <input type="number" name="rollno" placeholder="enter your roll number">
            <button id="btn" type="submit">submit</button>
        </form>
        <br>
        <hr>
        <%  if(details!=null) { %>
            <table class="table table-striped">
                <thead>
                  <tr>
                    <th scope="col">Roll No</th>
                    <th scope="col">Name</th>
                    <th scope="col">Email</th>
                    <th scope="col">Phone</th>
                    <th scope="col">Result</th>
                  </tr>
            </thead>
            <% details.forEach(function(item) { %>
                <tbody>
                    <tr>
                      <th scope="row"><%= item.rollno %></th>
                      <td><%= item.name %></td>
                      <td><%= item.email %></td>
                      <td><%= item.phone %></td>
                      <td><%= item.result %></td>
                    </tr>
                  </tbody>            
           <% }) %>
          </table>
          <% }  else { %>            
            <h4>Enter your phone number for result</h4>            
            <% }%>
    </div>
</section>

**nodejs code for fetch student result by roll number I can't able get it plz help how to fix it **

async result(req,res){   
            try{
                await studentResult.find({rollno: '987625'},function(err,allDetails){
                    if(err){
                        console.log(err);
                    }else {
                        //console.log(allDetails)
                     res.render('result',{details: allDetails})
                    }
                })
            }catch (e){
             console.log(e);
            }                   
        },

Mongodb errors show on terminal

MongooseError: Query was already executed: result.find({ rollno: 987625 }) at model.Query._wrappedThunk [as _find]

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