你知道我如何使用 nestJS + typeORM + nestjs-seeder 来播种随机关联实体吗 我只知道怎么用静态元素
@Factory('static_var')
或伪造者
@Factory(faker => faker.name.findName())
或自定义函数
@Factory(() => {
const minAge = 18;
const maxAge = 30;
return Math.round(Math.random() * (maxAge - minAge) + minAge);
})
但我希望能够从关联表中插入随机 ID