How to connect MongoDB to Openshift?

I have a NodeJS Express app that uses Mongoose for MongoDB. I'm confused as to how to connect it to the OpenShift database. For development, I'm connecting to a local database, which works fine. Here's what I have:

//====== MONGODB SETUP ======
mongo_url = process.env.OPENSHIFT_MONGODB_DB_HOST+":"+parseInt(process.env.OPENSHIFT_MONGODB_DB_PORT);

if(app.dev){
    mongo_url = "mongodb://localhost:27017/my-db";
}

app.modules.mongoose.connect(mongo_url);

Any help would be great!

You need more than just host and port. You have to provide username and password. A simpler way for it is to use:

mongo_url = process.env.OPENSHIFT_MONGODB_DB_URL;

OPENSHIFT_MONGODB_DB_URL has username and password too.