我想大声告诉你2017-05-02 09:20:04
如果最外层 List 可以改成数组的话,可以通过如下方式进行定义
const childChildSchema = new mongoose.Schema({
PlayerID: Number,
Msg: String,
Time: Date
});
const childSchema = new mongoose.Schema({
PlayerID: Number,
ReadLast: Date,
List:[childChildSchema]
});
const parentSchema = new mongoose.Schema({
ID: Number,
List: [childSchema]
});