fsd-nodejs / service-mw2

Node.js 全栈开发之 Midway.js 最佳实践

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

base model中id为string的意义?

xylplm opened this issue · comments

base model中id为string的意义是什么?数据库id不是基本都是int或者bugint类型?这里数据模型id也应该是number才是啊,为啥是string。求科普一下

有可能用的是 bigint 类型,db驱动程序自动转换为 string 输出,避免 js 处理 int/bigint 混乱