I'm curious as to the pros and cons of using subdocuments vs a deeper layer in my main schema:
var subDoc = new Schema({
name: String
});
var mainDoc = new Schema({
names: [subDoc]
});
or
var mainDoc = new Schema({
names: [{
name: String
}]
});
I'm currently using subdocs everywhere but I am wondering primarily about performance or querying issues I might encounter.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…