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.

Leave a Comment