【发布时间】:2012-07-14 08:28:33
【问题描述】:
我是 Mongoose 的新手,在官方文档中我没有找到任何与我需要的东西相关的内容。
如何声明动态的子架构?
例如:
var A = new Schema({
name : String,
subtype : String,
description : String
});
var B = new Schema({
name : String,
description : String
});
var C = new Schema({
name : String,
type : [if(type.value == 'A') then uses Schema-A;
if(type.value == 'B') then uses Schema-B;
]
});
希望它有意义。
提前致谢。
【问题讨论】: