Permalink
Browse files

Merge pull request #35 from giacomomacri/master

Added missing method for mongodb
  • Loading branch information...
2 parents ac5c342 + 5efc8b4 commit 033050e3401c5bf61f10ec31b2b811e5f769f949 @aliasaria committed Jan 3, 2012
Showing with 19 additions and 0 deletions.
  1. +19 −0 lib/data/mongodb.js
View
@@ -150,6 +150,25 @@ db.prototype = {
{name:room},
{$set:doc}
);
+ },
+ getBoardSize: function(room, callback) {
+ this.rooms.findOne(
+ {name:room},
+ function(err, room) {
+ if(room) {
+ callback(room.size);
+ } else {
+ callback();
+ }
+ }
+ );
+ },
+ setBoardSize: function(room, size) {
+ this.room.findOne({name:room})
+ this.rooms.update(
+ {name:room},
+ {$set:{'size':size}}
+ );
}
};
exports.db = db;

0 comments on commit 033050e

Please sign in to comment.