mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-01-27 09:39:19 +01:00
31 lines
457 B
JavaScript
31 lines
457 B
JavaScript
|
|
'use strict';
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Module dependencies
|
||
|
|
*/
|
||
|
|
var mongoose = require('mongoose'),
|
||
|
|
Schema = mongoose.Schema;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Check in Schema
|
||
|
|
*/
|
||
|
|
var CheckSchema = new Schema({
|
||
|
|
user: {
|
||
|
|
type: Schema.Types.ObjectId,
|
||
|
|
ref: 'User'
|
||
|
|
},
|
||
|
|
keepDays: {
|
||
|
|
type: Number,
|
||
|
|
default: 0
|
||
|
|
},
|
||
|
|
lastCheckedAt: {
|
||
|
|
type: Date,
|
||
|
|
default: Date.now
|
||
|
|
}
|
||
|
|
}, {usePushEach: true});
|
||
|
|
|
||
|
|
|
||
|
|
CheckSchema.index({user: 1, createdAt: -1});
|
||
|
|
|
||
|
|
mongoose.model('Check', CheckSchema);
|