lib/mongo_compat_api.js
function createDitcherInstance(mongoUrl, callback) {
  // Default config used by ditcher if no connection string
  // is provided
  var config = {
    database: {
      host: process.env.MONGODB_HOST || '127.0.0.1',
      port: process.env.FH_LOCAL_DB_PORT || 27017,
      name: 'FH_LOCAL'
    }
  };

  if (mongoUrl) {
    try {
      config = utils.parseMongoConnectionURL(mongoUrl);
    } catch(e) {
      return callback(e);
    }
  }

  var versString = (mongoUrl) ? "db per app" : "shared db";
  var ditcher = new fhditcher.Ditcher(config, logger, versString, function () {
    return callback(null, ditcher);
  });
}
function createDitcherInstance(mongoUrl, callback) {
  // Default config used by ditcher if no connection string
  // is provided
  var config = {
    database: {
      host: process.env.MONGODB_HOST || '127.0.0.1',
      port: process.env.FH_LOCAL_DB_PORT || 27017,
      name: 'FH_LOCAL'
    }
  };

  if (mongoUrl) {
    try {
      config = utils.parseMongoConnectionURL(mongoUrl);
    } catch(e) {
      return callback(e);
    }
  }

  var versString = (mongoUrl) ? "db per app" : "shared db";
  var ditcher = new fhditcher.Ditcher(config, logger, versString, function () {
    return callback(null, ditcher);
  });
}
function createDitcherInstance ( mongoUrl , callback ) { // Default config used by ditcher if no connection string // is provided var config = { database : { host : process . env . MONGODB_HOST || '127.0.0.1' , port : process . env . FH_LOCAL_DB_PORT || 27017 , name : 'FH_LOCAL' } } ; if ( mongoUrl ) { try { config = utils . parseMongoConnectionURL ( mongoUrl ) ; } catch ( e ) { return callback ( e ) ; } } var versString = ( mongoUrl ) ? "db per app" : "shared db" ; var ditcher = new fhditcher . Ditcher ( config , logger , versString , function ( ) { return callback ( null , ditcher ) ; } ) ; }
Create a ditcher instance in case we are working with a shared
database.

@param mongoUrl Mongodb connection string to be used
@param callback result callback
Create a ditcher instance in case we are working with a shared database .