gpt4 book ai didi

sequelize.js - 通过 Sequelize 在 MySQL 中将 1|2|3 存储为整数

转载 作者:行者123 更新时间:2023-12-03 22:43:40 25 4
gpt4 key购买 nike

我正在尝试通过 sequelize 将这种类型的整数“4|8|128”存储到 MySQL 的整数列中。

在 MYSQL 中,我可以使用原始查询来做到这一点。


How can I do so using sequelize without writing it as raw queries?

Reference: https://www.databasejournal.com/features/mssql/article.php/3359321/Storing-Multiple-Statuses-Using-an-Integer-Column.htm

最佳答案

当值为整数时,它似乎工作正常:

    myTestModel.update({
funkyField : 4 | 8 | 128
},
{where : {id : 1}
});

你尝试了什么?

关于sequelize.js - 通过 Sequelize 在 MySQL 中将 1|2|3 存储为整数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55532287/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com