I am create a post schema and In post schema I have a replies field where I track all replies related to the post and reply field is array of object but I don’t understand how do I create schema field for array of object any help?
var postSchema = new mongoose.Schema({
title: {
type: String,
required: true,
trim: true
},
description: {
type: String,
required: true,
trim: true
},
likes: {
type: Number
},
//this thing, the reply field is array of object
replies: {
type: Object
}
}, {
timestamps: true
});