Skip to content

Instantly share code, notes, and snippets.

@macalinao
Created June 21, 2012 22:45
Show Gist options
  • Save macalinao/2969075 to your computer and use it in GitHub Desktop.
Save macalinao/2969075 to your computer and use it in GitHub Desktop.
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