如何从sequelize回调中排除一些字符串

时间:2018-06-05 03:58:26

标签: mysql node.js orm sequelize.js

    static async create(ctx){
    const {content,uid,topicId} = ctx.request.body
    console.log(ctx.request.body);
    await infoListModel.create({
      content,uid,topicId
    }).then(data=>{
      ctx.body = {mes:'success',data}
    }).catch(err=>{
      ctx.body =err
    })
  }

然后我从邮差测试中得到结果

    {
    "mes": "发布成功",
    "data": {
        "like_count": 0,
        "post_count": 0,
        "infoId": 4,
        "content": "我是第一条数据",
        "uid": "1",
        "topicId": "1",
        "updatedAt": "2018-06-05T03:48:17.285Z",
        "createdAt": "2018-06-05T03:48:17.285Z"
    }
   }

现在我的问题是如何排除" updatedAt"," createdAt"," infoId"," topicId"来自续集回调

0 个答案:

没有答案