Set the time in mongoose schema

when I want to display the time when I want to leave a comment, my schema is written like this. After using moment.js, it shows the time when I wrote the comment for the first time after restarting node, and the time for writing the comment is the same as the first time. After restarting the server, the time for writing the comment is right again, and the second time is the same as the first one. No, no, no. , that new Date can"t even go to parentheses

var huatiSchema = new Schema({
username:{
    type:String,
    required:true
},
photo:{
    type:String,
    default:""
},
speak:{
    type:String,
    required:true
},
topic:{
    type:String,
    //required:true
    default:""
},
created_time:{
    type:String,
    default:moment(new Date()).format("YYYY-MM-DD HH:mm:ss")
},
},
{
versionKey: false 
})

clipboard.png


created_time: {
  type: String,
  default: () => moment(new Date()).format('YYYY-MM-DD HH:mm:ss'),
},

if you set a string to the default value, it will be fixed to the node startup time

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1beb34c-30fa3.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1beb34c-30fa3.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?