var SomeSchema = new Schema({
createdAt: {
type: Date
},
updatedAt: {
type: Date
},
title: {
type: String,
required: true
},
items: [{
title: {
type: String
},
children: {}
}]
}, {collection : 'SomeCollection'});
The children object is essentially another array of item objects, which can further have nested children. So this is for a menu system with inifnite nesting of the same Schema. How do I define it?