How can I add custom keys to to mongoose schema item?

I have a simple mongoose schema for a post:

const postSchema = new mongoose.Schema({
    title: {
        type: String,
        required: true,
        unique: true
    },

    body: {
        type: String,
        required: true,
        unique: false
    }
})

And I would like to add a custom key to each item called interface, that I could later use in a automatically generated post creation page.

Like this

const postSchema = new mongoose.Schema({
    title: {
        type: String,
        required: true,
        unique: true,
        interface: '<input type="text" name="title">'
    },
    
    body: {
        type: String,
        required: true,
        unique: false
        interface: '<textarea name="body">...</textarea>'
    }
})

But after creating a post with this schema and accesing this is the result.

{
  _id: new ObjectId("6151f2bbf678e03c1b2f609c"),
  title: 'a post',
  body: 'body...',
  __v: 0
}

How do I acceses the interface key of each property? like: post.title.interface

Answer

You access it on the Post class and not on a specific post; Post.schema.paths.title.options.interface.