Incorrect credentials in mongo node

Closes #386
This commit is contained in:
Nick O'Leary 2014-09-08 19:24:06 +01:00
parent c03db99a21
commit 1a5a548fbf
1 changed files with 2 additions and 2 deletions

View File

@ -27,8 +27,8 @@ module.exports = function(RED) {
this.name = n.name;
var url = "mongodb://";
if (this.credentials && this.credentials.username && this.credentials.password) {
url += this.credentials.username+":"+this.credentials.password+"@";
if (this.credentials && this.credentials.user && this.credentials.password) {
url += this.credentials.user+":"+this.credentials.password+"@";
}
url += this.hostname+":"+this.port+"/"+this.db;