I’m trying to create some documents using mongoose’s insertMany, but it fails when connecting to Mongo host.
My code is below:
const { current, last } = getDates();
const currentData = await getProofsOfDeliveryData(current);
const lastData = await getProofsOfDeliveryData(last);
const data = [...currentData, ...lastData];
await ProofOfDeliveryProd.deleteMany();
await ProofOfDeliveryProd.insertMany(data);
I expect to insert about 12k documents