Skip to content

Commit

Permalink
Merge pull request #11 from gabor-balla-emarsys/database-options
Browse files Browse the repository at this point in the history
Add options parameter to Database class
  • Loading branch information
drawain authored Jul 21, 2016
2 parents a0945a5 + 85e4f96 commit a041724
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/database/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

class Database {

constructor(mongoose, uri) {
constructor(mongoose, uri, options) {
this._mongoose = mongoose;
this._uri = uri;
this._options = options;
}


Expand All @@ -18,7 +19,7 @@ class Database {
if (this._mongoose.connection.readyState === 2) {
return this._mongoose.connection.once('connected', cb);
}
this._mongoose.connect(this._uri, cb);
this._mongoose.connect(this._uri, this._options, cb);
});
}

Expand Down

0 comments on commit a041724

Please sign in to comment.