var schema = mongoose.Schema({
name: {
type: String,
required: '请输入客户名称',
}, // 姓名
mobile: {
type: String,
validate: {
validator: function(v) {
// 这里要对当前表 做一些查询。。。应该怎么写?
},
message: '验证失败信息'
}
}
});
var model = mongoose.model('customer', schema);
回复 (0)
暂无回复,成为第一个参与讨论的人。
参与回复
登录后即可参与回复。登录