So, I was interested, although I realized that you cannot create a separate subdocument, I would still like to create a sub-document in order to correctly use standard and other types of mongooses, is there a way still doing this thing?
eg:
var SomeOtherScheme = new Schema({ a : { type:String, default:'test' }, b : { type:Boolean, default:false } ... }); var GroupSettings = new Schema({ x : { type:Number, default:20 }, y : { type:Boolean, default:false }, ... else : { type:SomeOtherScheme, default:SomeOtherScheme } }); var Group = new Schema({ name : { type:String , required:true, unique:true}, description : { type:String, required:true }, ... settings : {type:GroupSettings,default:GroupSettings} });
Bakbok
source share