【发布时间】:2016-04-22 21:26:45
【问题描述】:
假设我有这样的架构
var Language = new Schema({
name: { type: String, unique: true, required: true },
pos: [{
name: String,
attributes: [{
name: String
}]
}]
});
pos 和attributes 中的每个项目都有_id 吗?如果我向pos 数组中的name 字段添加唯一索引,是否会对该数组强制唯一性,还是对所有条目都是唯一的?
【问题讨论】: