vadimdemedes/mongorito

how to do bulk insert

rack021 opened this issue · 0 comments

*_addUpdateJobApplicant(applicants) {
    let count = 0;
    for (let applicant of applicants) {
      count++;
      if (applicant.jobId && applicant.email && typeof applicant === "object") {
        let jobApplicant = new JobApplicants(applicant);
        yield jobApplicant.save();
      } else {
        console.log(count);
      }
    }
  }

The above-mentioned function is able to insert document into db, but only to it's limit which is 50 documents, is there a to make bulk insert