我想大声告诉你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]
});