var easymongo = require('easymongo');

module.exports = function(options) {
  var mongo = new easymongo(options);

  return {
    find: function(collection, params, options) {
      return function(fn) {
        mongo.find(collection, params, options, fn);
      };
    },

    save: function(collection, params) {
      return function(fn) {
        mongo.save(collection, params, fn);
      };
    },

    remove: function(collection, id) {
      return function(fn) {
        mongo.removeById(collection, id, fn);
      };
    }
  };
};
var EasyMongo = require('easymongo');

module.exports = function(server, options) {
  var mongo = new EasyMongo(server, options);

  return {
    find: function(table, params, options) {
      return function(fn) {
        mongo.find(table, params, options, fn);
      };
    },

    findById: function(table, id) {
      return function(fn) {
        mongo.findById(table, id, fn);
      };
    },

    save: function(table, params) {
      return function(fn) {
        mongo.save(table, params, fn);
      };
    },

    remove: function(table, params) {
      return function(fn) {
        mongo.remove(table, params, fn);
      };
    },

    removeById: function(table, id) {
      return function(fn) {
        mongo.removeById(table, id, fn);
      };
    },

    count: function(table, params) {
      return function(fn) {
        mongo.count(table, params, fn);
      };
    }
  };
};
Add constructor arguments. Fix deprecated API. Add findById, removeById and count methods.
Add constructor arguments. Fix deprecated API. Add findById, removeById and count methods.
