0
我是结构化的数据验证有我使用的是自动窗体一些简单的模式:流星 - 与简单模式/自动窗体
Schemas.studentRecord = new SimpleSchema({
'common.FName': { // note that this field is nested
type: String,
optional: false,
label: "First Name",
max: 50
}
});
插入使用该架构的正常工作的文件。更新它也是。问题是,当我嵌套数据可选:false验证没有运行,它只是被忽略 - 这意味着我可以插入空白文档。但是使用下面的模式,而不嵌套它的工作原理:
Schemas.studentRecord = new SimpleSchema({
'commonFName': { // note that this field is no longer nested
type: String,
optional: false,
label: "First Name",
max: 50
}
});
所以我的问题是,我可以验证嵌套数据,或者我必须保持它的非结构化进行验证?