How can i capitalize strings in mongoose?

Best way is to use Mongooses Baked in functionality - this should do it!

Schema = {
 name:{
    type: String,
    uppercase: true
 },
 email: String,
 animal: String
};

CSS Styles are only on the visible side, not on the data side.

You have to use Javascript to do this:

schema.pre('save', function (next) {
  // capitalize
  this.name.charAt(0).toUpperCase() + this.name.slice(1);
  next();
});

Edit: As Luis Febro mentioned in the comments underneath, the current implementation keeps the upper/lowercase spelling of the rest of the string. If you really want to make sure, that there is only the first letter capitalized and the rest is built out of lowercase letters, you could adjust the code like this:

this.name.charAt(0).toUpperCase() + this.name.slice(1).toLowerCase()