Skip to content

Instantly share code, notes, and snippets.

@hansent
Created January 30, 2014 19:31
Show Gist options
  • Save hansent/8716949 to your computer and use it in GitHub Desktop.
Save hansent/8716949 to your computer and use it in GitHub Desktop.
models.js
var mongoose = require('mongoose');
mongoose.connect('mongodb://localhost/test');
var db = mongoose.connection;
var Schema = mongoose.Schema;
var playerSchema = new Schema({
name: String,
record: {
matches: {
won: Number,
lost: Number
},
sets: {
won: Number,
lost: Number
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment