server/backends/MongoDB-backend.js
function BackendStorage (gateway, opts){
    
    // prepare ourself to make debug possible
    this.debug  =opts.debug;
    this.gateway=gateway;

    this.opts=
       { hostname : opts.mongodb.hostname || "localhost"
       , username : opts.mongodb.username
       , password : opts.mongodb.password
       , basename : opts.mongodb.basename || opts.mongo.username
       , port     : opts.mongodb.port     || 27017
    };
    this.uid ="mongodb://" + this.opts.username + ':' + this.opts.password + "@" + this.opts.hostname +':'+ this.opts.port  + "/" + this.opts.basename;
    
    // create initial connection handler to database
    CreateConnection (this);  
}
function BackendStorage (gateway, opts){
    
    // prepare ourself to make debug possible
    this.debug  =opts.debug;
    this.gateway=gateway;

    this.opts=
       { hostname : opts.mongodb.hostname || "localhost"
       , username : opts.mongodb.username
       , password : opts.mongodb.password
       , basename : opts.mongodb.basename || opts.mongo.username
       , port     : opts.mongodb.port     || 27017
    };
    this.uid ="mongodb://" + this.opts.username + ':' + this.opts.password + "@" + this.opts.hostname +':'+ this.opts.port  + "/" + this.opts.basename;
    
    // create initial connection handler to database
    CreateConnection (this);  
}
function BackendStorage ( gateway , opts ) { // prepare ourself to make debug possible this . debug = opts . debug ; this . gateway = gateway ; this . opts = { hostname : opts . mongodb . hostname || "localhost" , username : opts . mongodb . username , password : opts . mongodb . password , basename : opts . mongodb . basename || opts . mongo . username , port : opts . mongodb . port || 27017 } ; this . uid = "mongodb://" + this . opts . username + ':' + this . opts . password + "@" + this . opts . hostname + ':' + this . opts . port + "/" + this . opts . basename ; // create initial connection handler to database CreateConnection ( this ) ; }
Create MongoDB Backend object
Create MongoDB Backend object