Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #35 from giacomomacri/master

Added missing method for mongodb
  • Loading branch information...
commit 033050e3401c5bf61f10ec31b2b811e5f769f949 2 parents ac5c342 + 5efc8b4
@aliasaria authored
Showing with 19 additions and 0 deletions.
  1. +19 −0 lib/data/mongodb.js
View
19 lib/data/mongodb.js
@@ -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.
Something went wrong with that request. Please try again.