Sequelize attributes 函数嵌套

想要的sql语句

SELECT `uid`, `nickname`, `avatar`,  `create_ip`, INET6_NTOA(UNHEX(create_ip)) AS `ip` FROM `user_info` 

attributes

      attributes: [
        'uid',
        'nickname',
        'avatar',
        [
          // 获取ip
          sequelize.fn('INET6_NTOA', sequelize.fn('UNHEX', sequelize.literal('create_ip'))),
          'ip'
        ], 
      ],

你可能感兴趣的:(Sequelize attributes 函数嵌套)