自定义架构的Mongoose验证

时间:2018-05-16 16:06:24

标签: validation mongoose mongoose-schema

我有这样的架构:

let schema1 = new Schema({
    code: String,
    translation: {}
});

和这样的anoter架构:

let schema2 = new Schema({
    content: String
});

例如,我想基于schema2对schema1.translation.en进行验证。

因为无法在对象上拥有动态密钥(根据我的搜索)。

提前致谢。

0 个答案:

没有答案
相关问题