Mongoose -- Force collection name

This should do it

var UserInfo = new Schema({
  username : String,
  password : String 
}, { collection: 'userinfo' });

See this link from the Mongoose documentation for more information.


If you are using mongoose 2.0.0, pass the collectionName as the third argument

mongoose.model('UserInfo', UserInfo, 'UserInfo');