var db = require('monk');


/**
 * botkit-storage-mongo - MongoDB driver for Botkit
 *
 * @param  {Object} config
 * @return {Object}
 */
module.exports = function(config) {
    /**
     * Example mongoUri is:
     * 'mongodb://test:test@ds037145.mongolab.com:37145/slack-bot-test'
     * or
     * 'localhost/mydb,192.168.1.1'
     */
    if (!config || !config.mongoUri)
        throw new Error('Need to provide mongo address.');

    var Teams = db(config.mongoUri).get('teams'),
        Users = db(config.mongoUri).get('users'),
        Channels = db(config.mongoUri).get('channels');

    var unwrapFromList = function(cb) {
        return function(err, data) {
            if (err) return cb(err);
            cb(null, data);
        };
    };

    var storage = {
        teams: {
            get: function(id, cb) {
                Teams.findById(id, unwrapFromList(cb));
            },
            save: function(data, cb) {
                Teams.findAndModify({
                    id: data.id
                }, data, {
                    upsert: true,
                    new: true
                }, cb);
            },
            all: function(cb) {
                Teams.find({}, cb);
            }
        },
        users: {
            get: function(id, cb) {
                Users.findById(id, unwrapFromList(cb));
            },
            save: function(data, cb) {
                Users.findAndModify({
                    id: data.id
                }, data, {
                    upsert: true,
                    new: true
                }, cb);
            },
            all: function(cb) {
                Users.find({}, cb);
            }
        },
        channels: {
            get: function(id, cb) {
                Channels.findById(id, unwrapFromList(cb));
            },
            save: function(data, cb) {
                Channels.findAndModify({
                    id: data.id
                }, data, {
                    upsert: true,
                    new: true
                }, cb);
            },
            all: function(cb) {
                Channels.find({}, cb);
            }
        }
    };

    return storage;
};

@@ -839,31 +839,36 @@
   Teams.find
-ById(
+One(%7Bid: 
 id
+%7D
 , unwrapFrom
@@ -1300,31 +1300,36 @@
   Users.find
-ById(
+One(%7Bid: 
 id
+%7D
 , unwrapFrom
@@ -1775,15 +1775,20 @@
 find
-ById(
+One(%7Bid: 
 id
+%7D
 , un

Change get() methods to find item by Slack id