【发布时间】:2016-11-10 01:26:20
【问题描述】:
我尝试保存一个法国号码电话,例如:060908...
这是我的身体要求:
newAppointment.phone = req.body.phone;
我的架构:
phone: {
type:Number,
required: true
}
和我的数据:06
这返回一个错误:SyntaxError: Unexpected number。当我将它转换为字符串时,它是 remove 0.
答案:使用 STRING。
【问题讨论】: