Skip to content

Instantly share code, notes, and snippets.

@rdallaire
Created July 30, 2014 02:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rdallaire/241dd48262ec856620c1 to your computer and use it in GitHub Desktop.
Save rdallaire/241dd48262ec856620c1 to your computer and use it in GitHub Desktop.
var data = {
"name": "Affinity",
"mainDeck": [
{"qty": 4, "name": "Mox Opal"},
{"qty": 4, "name": "Cranial Plating"},
{"qty": 3, "name": "Glimmervoid"},
{"qty": 4, "name": "Darksteel Citadel"},
{"qty": 4, "name": "Galvanic Blast"},
{"qty": 3, "name": "Etched Champion"},
{"qty": 4, "name": "Ornithopter"},
{"qty": 2, "name": "Memnite"},
{"qty": 4, "name": "Sigil Pest"},
{"qty": 4, "name": "Springleaf Drum"},
{"qty": 1, "name": "Island"},
{"qty": 3, "name": "Steel Overseer"},
{"qty": 4, "name": "Thoughtcast"},
{"qty": 4, "name": "Arcbound Ravager"},
{"qty": 4, "name": "Blinkmoth Nexus"},
{"qty": 4, "name": "Inkmoth Nexus"},
{"qty": 4, "name": "Vault Skirge"}
]
}
$http.post('http://localhost:8080/api/decks', data);
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
var DeckSchema = new Schema({
name: String,
mainDeck: [
{
qty: Number,
name: String
}
]
});
module.exports = mongoose.model('Deck', DeckSchema);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment