2014-10-20 59 views
0

我想創建一個存儲陣列。而在每家商店,都會有部分。所以一家商店可能有一個熟食店和生產部分。另一家商店可能只是收銀員和肉類部分。在貓鼬模式中創建數組INSERE數組

var UserSchema = new Schema({ 
    store: { 
    type: Array, 
    }, 
    section: { // how do I put this inside the store array? 
    type: Array, 
    } 
}); 

回答

0

,我們可以通過指定類型的混合做它,它會接受任何類型的數據結構法

var UserSchema = new Schema({ 
    store: [{ 
     type: Schema.Types.Mixed 
    }] 
});