Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
4.5k views
in Technique[技术] by (71.8m points)

how can I write a parent comment with children comments in schema mongoose

I writte my principal parent comment but I don't know how can I add a list of children comments with the same field:

const CommentSchema = new Schema({
    id_parent : {
        type: Number,
         },
    user_name: {
        type: String,
        trim: true,
        required: true,
        },
    content: {
        type: String,
        },
    created_date: {
        type: Date,
        default: Date.now,
      },
    counter_like: {
        type: Number,
        required:false,
      },
    status : {
        type: String,
         },
    });

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神解答

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...