Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

206
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!