我有一个模型,我需要一个字段来存储对象的数组,而这些对象我不知道其结构。
使用混合类型扩展基础架构无法正常工作
var Schema = mongoose.Schema;
MyList.schema.add({
ImageData: {type:Schema.Types.Mixed}, // for storing entire JS objects
});
ImageData : [
{
"Uri":"Test.com",
"Hash":"42e04950d6f11cd5350e3179083c7c7f",
"Path":"/public/server/img/de29d68ab3594032bef70ead0b0d8fc2.jpg"
},
{
"Uri":"Test.com",
"Hash":"42e04950d6f11cd5350e3179083c7c7f",
"Path":"/public/server/img/de29d68ab3594032bef70ead0b0d8fc2.jpg"
}
]
Data.add({
name: { type: String, required: false },
Type: { type: Types.Select, options: 'New, Used,', index: true },
ImageData: { type: Types.TextArray },
content: {
brief: { type: Types.Html, wysiwyg: true, height: 150 },
extended: { type: Types.Html, wysiwyg: true, height: 400 },
},
});