Which schema is more professional?

Hi everybody, I am making a social networking application. But I’m a little confused about the schema. Which of these is a more professional structure? Or what build would you recommend? Is it better to create a separate model for the comment or specify it as an array in the Post?

example 1:

const CommentSchema = new mongoose.Schema(
  {
    commenter: {
      type: mongoose.Types.ObjectId,
      ref: "user",
      required: true,
    },
    post: {
      type: mongoose.Types.ObjectId,
      ref: "post",
      required: true,
    },
    content: {
      type: String,
      required: true,
    },
    parent: {
      type: mongoose.Types.ObjectId,
      ref: "comment",
    },
    children: [
      {
        type: mongoose.Types.ObjectId,
        ref: "comment",
      },
    ],
    edited: {
      type: Boolean,
      default: false,
    },
  },
  { timestamps: true }
);

example 2

const commentSchema = new mongoose.Schema({
  text: {
    type: String,
    required: true,
  },
  author: {
    type: mongoose.Schema.Types.ObjectId,
    ref: 'User',
    required: true,
  },
  post: {
    type: mongoose.Schema.Types.ObjectId,
    ref: 'Post',
    required: true,
  },
  likes: [
    {
      type: mongoose.Schema.Types.ObjectId,
      ref: 'User',
    },
  ],
  replies: [
    {
      type: mongoose.Schema.Types.ObjectId,
      ref: 'Comment',
    },
  ],
  edited: {
    type: Boolean,
    default: false,
  },
  editedAt: {
    type: Date,
  },
  createdAt: {
    type: Date,
    default: Date.now,
  },
});

Hello, @R5_Vzn ! Welcome to the MongoDB community! :wave:

Try to avoid the situation where your document contains array that can expand infinitely. This may cause a problem, when the document grows big enough, so it hits 16MB BSON-document limit. Moreover big documents may be the problem if you try to $group them in the aggregation pipeline, while this stage also has its limit of 100 MB, so it you have plenty of large documents you can quickly exceed that limitation.

Comments that can have replies represent a tree structure. I would suggest you to model your schemas comments data like a tree structure with parent references.