📜  自定义时间戳名称 mongoose - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:21.245000             🧑  作者: Mango

代码示例1
const mongoose = require('mongoose');  
const { Schema } = mongoose;
    
const schemaOptions = {
  timestamps: { createdAt: 'created_at', updatedAt: 'updated_at' },
};

const mySchema = new Schema({ name: String }, schemaOptions);