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
})
點數字段用於記錄一條評論的投票。每次用戶投票評論時,我都不想更改時間戳。有沒有辦法做到這一點?或者我應該將點域移出該模式嗎?