mongoose schema nested objectid code example
Example 1: array schema mongoose
const ToySchema = new Schema({ name: String });
const ToyBoxSchema = new Schema({
toys: [ToySchema],
buffers: [Buffer],
strings: [String],
numbers: [Number]
// ... etc
});
Example 2: mongoose nested object without id
var subSchema = mongoose.Schema({
//your subschema content
},{ _id : false });