docs: function (params) {
    assert.ok(params.__fhdb, "__fhdb parameter required for shared database");
  
    /**
     * Copy the default options that are always required by ditcher
     * @param target The options object to copy them to
     * @returns The options object plus the default properties
     */
    this.copyDefaultOptions = function (target) {
      target.__fhdb = params.__fhdb;
      target.__dbperapp = params.__dbperapp;
      return target;
    };
  
    /**
     * Create a new collection
     * http://mongodb.github.io/node-mongodb-native/2.0/api/Db.html#createCollection
     * @param name collection name
     * @param (optional) options
     * @param (optional) callback results callback
     * @returns Promise if no callback passed
     */
    this.createCollection = function (name, options, callback) {
      assert.ok(name, "collection name required");
  
      if (typeof options === "function") {
        callback = options;
        options = {};
      }
  
      options = this.copyDefaultOptions(options || {});
      options.type = name;
  
      if (callback) {
        params.ditcher.doCreate(options, callback);
      } else {
        return new Promise(function (resolve, reject) {
          params.ditcher.doCreate(options, function (err, collection) {
            if (err) {
              return reject(err);
            }
  
            resolve(collection);
          });
        });
      }
    };
  
    /**
     * Drop a collection
     * http://mongodb.github.io/node-mongodb-native/2.0/api/Db.html#dropCollection
     * @param name
     * @param (optional) callback
     * @returns Promise if no callback passed
     */
    this.dropCollection = function (name, callback) {
      assert.ok(name, "collection name required");
  
      var options = {
        type: name
      };
  
      options = this.copyDefaultOptions(options || {});
  
      if (callback) {
        params.ditcher.doDropCollection(options, callback);
      } else {
        return new Promise(function (resolve, reject) {
          params.ditcher.doDropCollection(options, function (err, result) {
            if (err) {
              return reject(err);
            }
  
            resolve(result);
          });
        });
      }
    };
  
    /**
     * List all collections
     * http://mongodb.github.io/node-mongodb-native/2.0/api/Db.html#listCollections
     * @param filter Query to filter collections by
     * @param options (optional) Optional settings
     * @returns Cursor
     */
    this.listCollections = function (filter, options) {
      options = this.copyDefaultOptions(options || {});
      return params.ditcher.doGetCollectionsListCursor(filter, options);
    };
  
    /**
     * Return collections instance
     * http://mongodb.github.io/node-mongodb-native/2.0/api/Db.html#collection
     * @param name Query to filter collections by
     * @param options (optional) Optional settings
     * @param callback (optional) result callback
     * @returns Collection instance if no callback passed
     */
    this.collection = function (name, options, callback) {
      assert.ok(name, "collection name required");
  
      options = this.copyDefaultOptions(options || {});
      options.type = name;
  
      return params.ditcher.doGetCollectionInstance(options, callback);
    };
  
    /**
     * Create an index on collection
     * http://mongodb.github.io/node-mongodb-native/2.0/api/Db.html#createIndex
     * @param name Name of the collection
     * @param fieldOrSpec Field to use for the index
     * @param options (optional) Options
     * @param callback (optional) result callback
     * @returns Promise if no callback passed
     */
    this.createIndex = function (name, fieldOrSpec, options, callback) {
      assert.ok(name, "collection name required");
      assert.ok(fieldOrSpec, "index spec required");
  
      if(typeof options === "function") {
        callback = options;
        options = {};
      }
  
      options = this.copyDefaultOptions(options || {});
      options.type = name;
      options.index = fieldOrSpec;
  
      if (callback) {
        params.ditcher.doIndex(options, callback);
      } else {
        return new Promise(function (resolve, reject) {
          params.ditcher.doIndex(options, function (err, result) {
            if (err) {
              return reject(err);
            }
  
            resolve(result);
          });
        });
      }
    };
  
    /**
     * Rename a collection
     * http://mongodb.github.io/node-mongodb-native/2.0/api/Db.html#renameCollection
     * @param fromCollection Current name
     * @param toCollection New name
     * @param options (optional) Options
     * @param callback (optional) Result callback
     */
    this.renameCollection = function (fromCollection, toCollection, options, callback) {
      assert.ok(fromCollection, "current collection name required");
      assert.ok(toCollection, "new collection name required");
  
      if(typeof options === "function") {
        callback = options;
        options = {};
      }
  
      options = this.copyDefaultOptions(options || {});
      options.type = fromCollection;
      options.toCollection = toCollection;
  
      if (callback) {
        params.ditcher.doRenameCollection(options, callback);
      } else {
        return new Promise(function (resolve, reject) {
          params.ditcher.doRenameCollection(options, function (err, result) {
            if (err) {
              return reject(err);
            }
  
            resolve(result);
          });
        });
      }
    };
  
    /**
     * Close the database connection
     * http://mongodb.github.io/node-mongodb-native/2.0/api/Db.html#close
     * @param force Force close, emitting no events
     * @param callback (optional) result callback
     */
    this.close = function (force, callback) {
      if (typeof force === "function") {
        callback = force;
        force = false;
      }
  
      return params.ditcher.database.close(force, callback);
    };
  }