Ask Mongoose to define nested data Schema?

  mongodb, question

图片描述

Can you tell me how to define Schema and how to use push to operate List array for such data?

If the outermost List can be changed to an array, it can be defined as follows

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]
 });