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

137
Views
How do i finish one task before going to another in JS

I'm using mongoose and want to use .insertMany() and wait it to finish before using .find() operation. Can't figure out how to do it using async/await .

    Fruit.insertMany([kivi,orange,mango],function(e) {
    if(e) {console.log(err);}
   else { console.log("operation succesful: saved all fruits to DB");}
   });



 Fruit.find({name:'kivi'}  ,function(e, fruits){
  if(e)  console.log(e);
  else   console.log(fruits);
})
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!