Spaces:
Running
Running
| const { mongoose } = require("mongoose"); | |
| const Schema = mongoose.Schema; | |
| const loginAccountSchema = new Schema({ | |
| timestamp: { | |
| type: Date, | |
| default: Date.now() | |
| }, | |
| UserID: { | |
| type: Schema.Types.ObjectId, | |
| ref: "User" | |
| }, | |
| TeamId: { | |
| type: Schema.Types.ObjectId, | |
| ref: "Team" | |
| }, | |
| SessionID: { | |
| type: String | |
| }, | |
| Status: { | |
| type: Number | |
| }, | |
| }); | |
| loginAccountSchema.virtual("url").get(function () { | |
| return `/sessions/${this._id}`; | |
| }); | |
| module.exports = mongoose.model("Authentication", loginAccountSchema); |