Meteor package to consume mtg:json and create a mongodb collection representing the data.
mtg
This repository has been archived on 2026-09-29. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
  • JavaScript 100%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2015-08-31 00:27:09 -06:00
.versions update description and packaging 2015-08-31 00:20:27 -06:00
carddb-tests.js init 2015-08-30 21:42:34 -06:00
carddb.js refactor 2015-08-30 23:03:45 -06:00
Cards.js add set method to collection 2015-08-31 00:02:04 -06:00
CHANGELOG.md init changelog 2015-08-31 00:04:28 -06:00
package.js update description and packaging 2015-08-31 00:20:27 -06:00
README.md new readme 2015-08-31 00:27:09 -06:00

mtg:carddb

meteor add mtg:carddb

This uses the mtg:json package to get MTG card data from the npm mtgjson package.

It creates a collection on the primary mongo database of the name mtg_cards and inserts a document into the collection for every card available via mtgjson.

MTGCards Methods

These methods are available on the MTGCards collection object. They are used to access parts of the mtg_cards collection without requiring a lot of boilerplate.

set(set_name, selector, options)

returns a cursor of MTGCards.

MTGCard methods

These methods are made available on the documents returned from MTGCards using dburles:collection-helpers.

Usage example


var card = MTGCards.findOne();
card.isLegal("STANDARD");

isLegal

Note: Example. Not yet implemented.

This method takes a format ("STANDARD", "MODERN", "VINTAGE", "COMMANDER") and returns if the card is legal in that format.

Dependencies

  • Collection Helpers
  • Collection2
  • SimpleSchema

Note: May take several minutes to prepare the database on the first run. It inserts ~30k documents.