elo mongoose plugin
A mongoose plugin that adds the ability to use the elo rating system on a model. Built using my elo-rank library. Note: only tested on node v5.0.0
example
const mongoose = ;const eloPlugin = ; let schema = name: String; schema; const TestModel = mongoose; TestModel;
api
model.rating
the added rating columnModel#updateRatings
used to save a match outcomeModel#sortByRating
returns a chainable mongoose query object sorted by rating, if a callback is provided it executes the query
license
do wutever u want whenever u feel like it