I've encountered a bizarre error trying to connect to a MongoHQ MongoDB on Heroku using NodeJS. It worked before and now it has stopped to work. I can connect to database on my local machine, so I guess that MongoHQ is working just fine. On Heroku, the following minimal example throws "Error: failed to connect to [mongodb://xyz.mongohq.com]". Any idea what's wrong?
var Fiber = require('fibers');
var MongoSync = require("mongo-sync");
Fiber(function() {
try {
var server = new MongoSync.Server("mongodb://xyz.mongohq.com:12345");
var db = server.db("app12345678");
db.auth("heroku", "password");
var collection = db.getCollection("my_collection");
console.log(collection.count());
} catch (e) {
console.log(e);
}
process.exit(0);
}).run();