mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-06 11:30:13 +08:00
Connect to mongodb, define schemas
This commit is contained in:
1 parent
d51a75e5bc
commit
50443b96e0
13 files changed
+216
-12
No files matched your search
@@ -0,0 +1,20 @@
|
||||
import { model, Schema } from 'mongoose'
|
||||
|
||||
export default model(
|
||||
'Session',
|
||||
{
|
||||
name: String,
|
||||
containerId: String,
|
||||
user: {
|
||||
type: Schema.ObjectId,
|
||||
ref: 'User',
|
||||
},
|
||||
quest: {
|
||||
type: Schema.ObjectId,
|
||||
ref: 'Quest',
|
||||
},
|
||||
finishedAt: Date,
|
||||
terminals: [String],
|
||||
},
|
||||
{ timestamps: true }
|
||||
)
|
||||
Reference in new issue
Block a user