I have 1 Model for blogPosts:

```
const blogSchema= new mongoose.Schema({
  userId: {
    type: mongoose.Schema.Types.ObjectId,
    ref: "User",
  },
  name: {
    type: String,
    required: true,
    max: 50,
    min: 6,
  },
  description: {
    type: String,
    required: true,
    max: 1024,
    min: 25,
  },
  date: {
    type: Date,
    default: Date.now,
  },
  comment: [commentSchema],
});

```

The important part here is the last field **comment**. For it I have another schema:

```
    const commentSchema = new mongoose.Schema({
      date: {
        type: Date,
        default: Date.now,
      },
      comment: {
        type: String,
        max: 1024,
        min: 5,
      },
      userId: {
        type: mongoose.Schema.Types.ObjectId,
        ref: "User",
      },
    });

```

Normally when post is created, then the comments can be added. In a separate file User.js I have model for User:

```
const userSchema = new mongoose.Schema({
  name: {
    type: String,
    unique: true,
    required: true,
    max: 255,
    min: 6,
  },
  email: {
    type: String,
    unique: true,
    required: true,
  },

  password: {
    type: String,
    required: true,
    min: 6,
  },
  date: {
    type: Date,
    default: Date.now,
  },
});

```

How I can connect these to work together. I have endpoint where all posts are visible (no matter which user provided them). I want 1 user to be able to comment post on another user and his name to appear under it.

So any ideas how I can create:

1. Endpoint which will store comments in blogSchema's comment field
2. User will be recorded in commentSchema