0
MongoHQ 데이터베이스에 빌드 한 앱을 연결하려고합니다.노드에서 MongoHQ에 연결 중 오류
mongo = require('mongodb')
Server = mongo.Server
Db = mongo.Db
BSON = mongo.BSONPure;
con = null;
server = new Server('staff.mongohq.com', 'THE_PORT', {auto_reconnect: true});
DBCon = new Db('THE_DB', server, {safe: false});
DBCon.authenticate('test_user', 'test_pass', function() {});
DBCon.open(function(err, db) { if(!err) { con = db; } });
나는 데이터베이스와 MongoHQ에서 만든 사용자를 가지고 :
이
는 코드입니다. 명령 줄에서 연결하면 모든 것이 완벽하게 작동합니다.return this.connectionPool.getAllConnections();
TypeError: Cannot call method 'getAllConnections' of undefined
그것은 데이터베이스에 연결하는 데 실패 : 내 응용 프로그램을 실행할 때
는하지만,이 오류가 발생합니다. 그러나 인증없이 로컬 데이터베이스에 연결하면 제대로 작동합니다.
그래서 오류는 무엇이며 어떻게 수정해야합니까?
감사합니다. : D