Mongoose - Reference Error: string is not defined

Posted about 3 years ago

When setting up a new Schema with mongoose and MongoDB, make sure you capitalise the first letter if you’re receiving the error ReferenceError: string is not defined

// schema
var peopleSchema = new mongoose.Schema({
  name: String,
  number: Number,
  email: String

This may sound like an obvious one, but it caught me out for a moment or two.