feat: add Timestamps to User model

This commit is contained in:
wancat committed 2023-10-14 15:42:39 +08:00
1 parent 916b78240c
commit d3dd12a547
1 file changed
+11 -3
+11 -3
View File
@@ -1,6 +1,9 @@
import { model } from 'mongoose'
import { model, Schema } from 'mongoose'
const User = model('User', {
const User = model(
'User',
new Schema(
{
username: {
type: String,
unique: true,
@@ -20,6 +23,11 @@ const User = model('User', {
id: String,
displayName: String,
},
})
},
{
timestamps: true,
}
)
)
export default User