2014-06-30 22:16:26 -04:00
|
|
|
mongoose = require 'mongoose'
|
2014-02-07 18:52:24 -05:00
|
|
|
|
|
|
|
ScoringTaskSchema = new mongoose.Schema(
|
2014-02-08 17:21:37 -05:00
|
|
|
createdAt: {type: Date, expires: 3600} #expire document 1 hour after they are created
|
2014-06-30 22:16:26 -04:00
|
|
|
calculator: {type: mongoose.Schema.Types.ObjectId}
|
2014-02-08 13:11:43 -05:00
|
|
|
sentDate: {type: Number}
|
2014-02-07 18:52:24 -05:00
|
|
|
messageIdentifierString: {type: String}
|
|
|
|
calculationTimeMS: {type: Number, default: 0}
|
|
|
|
sessions: {type: Array, default: []}
|
|
|
|
)
|
|
|
|
|
2015-01-27 13:02:47 -05:00
|
|
|
ScoringTaskSchema.index({createdAt: 1}, {expireAfterSeconds: 3600})
|
|
|
|
|
2014-02-07 18:52:24 -05:00
|
|
|
module.exports = mongoose.model('scoringTask', ScoringTaskSchema)
|