Spaces:
Running
Running
File size: 599 Bytes
df72131 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
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); |