mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-01-17 12:52:22 +01:00
60 lines
899 B
JavaScript
60 lines
899 B
JavaScript
'use strict';
|
|
|
|
/**
|
|
* Module dependencies
|
|
*/
|
|
var mongoose = require('mongoose'),
|
|
Schema = mongoose.Schema;
|
|
|
|
/**
|
|
* Collection Schema
|
|
*/
|
|
var CollectionSchema = new Schema({
|
|
user: {
|
|
type: Schema.Types.ObjectId,
|
|
ref: 'User'
|
|
},
|
|
tmdb_id: {
|
|
type: Number,
|
|
default: 0
|
|
},
|
|
name: {
|
|
type: String,
|
|
trim: true,
|
|
default: ''
|
|
},
|
|
overview: {
|
|
type: String,
|
|
trim: true,
|
|
default: ''
|
|
},
|
|
poster_path: {
|
|
type: String,
|
|
trim: true,
|
|
default: ''
|
|
},
|
|
backdrop_path: {
|
|
type: String,
|
|
trim: true,
|
|
default: ''
|
|
},
|
|
torrents: [{
|
|
type: Schema.Types.ObjectId,
|
|
ref: 'Torrent'
|
|
}],
|
|
recommend_level: {
|
|
type: String,
|
|
default: 'none'
|
|
},
|
|
created_at: {
|
|
type: Date,
|
|
default: Date.now
|
|
},
|
|
ordered_at: {
|
|
type: Date,
|
|
default: Date.now
|
|
}
|
|
}, {usePushEach: true});
|
|
|
|
mongoose.model('Collection', CollectionSchema);
|