Mongoose connect has 3 parameters, uri, options, and the callback function. To use them see sample below.
var mongoose = require('mongoose');
var uri = 'mongodb://localhost:27017/DBNAME';
var options = {
user: 'user1',
pass: 'pass'
}
mongoose.connect(uri, options, function(err){
if (err) throw err;
// if no error == connected
});