mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-08 11:30:12 +08:00
feat: add Timestamps to User model
This commit is contained in:
1 parent
916b78240c
commit
d3dd12a547
1 file changed
+11
-3
+11
-3
@@ -1,6 +1,9 @@
|
|||||||
import { model } from 'mongoose'
|
import { model, Schema } from 'mongoose'
|
||||||
|
|
||||||
const User = model('User', {
|
const User = model(
|
||||||
|
'User',
|
||||||
|
new Schema(
|
||||||
|
{
|
||||||
username: {
|
username: {
|
||||||
type: String,
|
type: String,
|
||||||
unique: true,
|
unique: true,
|
||||||
@@ -20,6 +23,11 @@ const User = model('User', {
|
|||||||
id: String,
|
id: String,
|
||||||
displayName: String,
|
displayName: String,
|
||||||
},
|
},
|
||||||
})
|
},
|
||||||
|
{
|
||||||
|
timestamps: true,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
export default User
|
export default User
|
||||||
Reference in new issue
Block a user