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

207
Vistas
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 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