While working with my House data seeder, I encountered a strange issue. Even though my code loops through the end, it only saves 5 records in the month model.
const insertMonths = houses.map((house, i) => {
const months = new Month({ year: "2021" });
months.save();
console.log(i);
return { ...house, months: months._id };
});
await House.insertMany(insertMonths);
I'm puzzled by what might be causing this unexpected behavior.