database/mongo-db.js
function MongoDB(host, port, database, collection, username, password){
        _self = this;

        if(arguments.length < 3){
            throw ("MongoDB constructor requires at least three arguments!");
        }

        if(collection){
            _collection = collection;
        } else{
            _collection = DEFAULT_COLLECTION_NAME;
        }

        _username = username;
        _password = password;

        _host = host;

        //create new database connection
        _db = new Db(database, new Server(host, port), {safe:false}, {auto_reconnect: true});
    }
function MongoDB(host, port, database, collection, username, password){
        _self = this;

        if(arguments.length < 3){
            throw ("MongoDB constructor requires at least three arguments!");
        }

        if(collection){
            _collection = collection;
        } else{
            _collection = DEFAULT_COLLECTION_NAME;
        }

        _username = username;
        _password = password;

        _host = host;

        //create new database connection
        _db = new Db(database, new Server(host, port), {safe:false}, {auto_reconnect: true});
    }
function MongoDB ( host , port , database , collection , username , password ) { _self = this ; if ( arguments . length < 3 ) { throw ( "MongoDB constructor requires at least three arguments!" ) ; } if ( collection ) { _collection = collection ; } else { _collection = DEFAULT_COLLECTION_NAME ; } _username = username ; _password = password ; _host = host ; //create new database connection _db = new Db ( database , new Server ( host , port ) , { safe : false } , { auto_reconnect : true } ) ; }
Wrapper class for MongoDB for use with the Blocker modules.
Host and port specify on which computer MongoDB is running.
@param host Host of the database which shall be used for the Blocklist.
@param port Number of the port which shall be used for the Blocklist.
@param database Name of the database which shall be used for the Blocklist.
@param collection Name of the collection that shall be used for the Blocklist.
@param username optional parameter for username to connect to database.
@param password optional parameter for password to connect to database.
@attention This class is permanently holding a connection to the database.
Wrapper class for MongoDB for use with the Blocker modules . Host and port specify on which computer MongoDB is running .