mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-02-02 12:39:25 +01:00
51 lines
743 B
JavaScript
51 lines
743 B
JavaScript
'use strict';
|
|
|
|
/**
|
|
* Module dependencies
|
|
*/
|
|
var mongoose = require('mongoose'),
|
|
Schema = mongoose.Schema;
|
|
|
|
/**
|
|
* Peer Schema
|
|
*/
|
|
var UserMonthsLogSchema = new Schema({
|
|
user: {
|
|
type: Schema.Types.ObjectId,
|
|
ref: 'User'
|
|
},
|
|
year: {
|
|
type: Number,
|
|
default: 0
|
|
},
|
|
month: {
|
|
type: Number,
|
|
default: 0
|
|
},
|
|
uploaded: {
|
|
type: Number,
|
|
default: 0
|
|
},
|
|
downloaded: {
|
|
type: Number,
|
|
default: 0
|
|
},
|
|
score: {
|
|
type: Number,
|
|
default: 0
|
|
},
|
|
createdAt: {
|
|
type: Date,
|
|
default: Date.now
|
|
},
|
|
updatedAt: {
|
|
type: Date,
|
|
default: Date.now
|
|
}
|
|
}, {usePushEach: true});
|
|
|
|
|
|
UserMonthsLogSchema.index({user: 1, year: 1, month: 1});
|
|
|
|
mongoose.model('UserMonthsLog', UserMonthsLogSchema);
|