Created
June 21, 2012 22:45
-
-
Save macalinao/2969075 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var mongoose = require('mongoose'); | |
var Schema = mongoose.Schema; | |
var Player = require('./player'); | |
var Game = new Schema({ | |
type: { | |
type: String, | |
required: true | |
}, | |
date: { | |
type: Date, | |
required: true | |
}, | |
rankings: [ | |
{ | |
time: Number, | |
player: { | |
type: Schema.ObjectId, | |
ref: 'Player' | |
}, | |
kills: [Player.schema], | |
"class": String | |
} | |
] | |
}); | |
module.exports = mongoose.model('Game', Game); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment