I have a code that maps through my House data seeder with a relation of month, weird thing that happens is it loops through the end but 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 don't know what causes this behavior.