如何将插入的数据设置为number类型

发布于 7 年前作者 tao6312673 次浏览最后编辑 7 年前来自 ask

在云开发控制台是可以设置字段类型的,想在插入数据的时候就设置为number类型

db.collection(‘atest’).add({

data: {

price: this.data.mount,     ------》想要插入这个price字段为number类型要怎么做?

type: t,

time: y + ‘-’ + m + ‘-’ + d,

note: this.data.noteInput,

sort:s

},

1 回复
bzhou
bzhou1 楼5 年前

parseInt(this.data.mount)