0
当我试图保存在数据库中的数据,它给禁消息猫鼬验证给“CastError:铸铁未定义的失败值”
CastError:铸铁未定义的失败值
[
{"product":{"supplierId":{"undefined":"rfytr"}}},
{"product":{"supplierId":{"$empty":"rfytr"}}}
] at path "condition"
我无法弄清楚问题所在。 我的架构是
var mongoose = require('mongoose'),
validator = require('mongoose-validators'),
Schema = mongoose.Schema;
var RuleSchema = new Schema({
description: {
type: String,
validate: [validator.isLength(1, 50)]
},
status: {
type: String,
enum: ['live', 'active', 'paused', 'inactive', 'unfinished']
},
/**
condition. It can only contain object.
*/
condition: [{
type: Object
}]
});