Let take this sample
我们来看看这个样本
export let index = (req: Request, res: Response) => {
for (let i = 0; i < 10; i++) {
let bulk = Faker.collection.initializeUnorderedBulkOp();
for (let y = 0; y < 200000; y++) {
bulk.insert({
name: randomName(),
nights: Math.random(),
price: Math.random(),
type1: Math.random(),
type2: Math.random(),
type3: Math.random(),
type4: Math.random(),
departure: mongoose.Types.ObjectId(randomAreaID()),
destination: mongoose.Types.ObjectId(randomAreaID()),
refundable: randomBool(),
active: randomBool(),
date_start: randomDate(),
date_end: randomDate(),
});
}
bulk.execute();
}
return res.json({data: true});
};
export let i