This repository has been archived by the owner on Apr 15, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
/
character.js
31 lines (29 loc) · 1.62 KB
/
character.js
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
31
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
var CharacterSchema = new Schema({
name : {type: String, required: true, unique: true}, // Rhaegar
titles : [String], // Prince of Dragonstone Ser
male : Boolean, // Male
culture : String, // Valyrian
age : {type: Number, min: 1, max: 200}, // ??
dateOfBirth: Number, // 259 AC
dateOfDeath: Number, // 283 AC
actor : String,
mother: {type: String, ref: 'Character'},
father: {type: String, ref: 'Character'},
heir : {type: String, ref: 'Character'},
placeOfBirth: {type: String, ref: "Region"}, // Summerhall
placeOfDeath: {type: String, ref: "Region"}, // Trident
house : {type: String, ref: "House"}, // House Targaryen
createdAt : {type: Date, default: Date.now},
updatedAt : {type: Date, default: Date.now},
spouse : {type: String, ref: 'Character'},
allegiance : {type: String, ref: 'Character'},
pageRank: Number,
books : [String],
placeOfLastVisit : {type: String, ref: "Region"},
imageLink : String,
slug : String,
hasPath : Boolean
});
module.exports = mongoose.model('Character', CharacterSchema);