老师你好,我们新建都是一条一条数据的插入,
我想测试,批量插入多条数据,请问如何做?
verifyParams 验证要如何修改?
async create(ctx){
ctx.verifyParams({
content:{type:'string',required:true},
});
const answerer = ctx.state.user._id;
const { questionId } = ctx.params;
const answer = await new Answer({...ctx.request.body,answerer,questionId}).save();
ctx.body = answer;
}