0
我目前正在设计猫鼬纲要。该模式适用于博客评论,如下所示:有没有办法在猫鼬模式中选择性应用时间戳?
new mongoose.Schema({
commentedOn: {
type: mongoose.Schema.Types.ObjectId,
required: true
},
author: {
type: String,
required: true
},
contents:{
type: String
},
points: {
type: Number,
default:0
},
timestamps: true
})
点数字段用于记录一条评论的投票。每次用户投票评论时,我都不想更改时间戳。有没有办法做到这一点?或者我应该将点域移出该模式吗?