Mongoose save error Mongoose save error mongoose mongoose

Mongoose save error


It works if you change your schema to this:

var Schema = new mongoose.Schema({  email: String,  name: String,  age: Number});

I would also recommend changing the model from "emp" to just be "user". Or all the vars from "user" to "emp". Being consistent is more readable and will save you time later down the road. Also it looks like you are missing the: require('jade') at the top.

You can query by email to find a user. Mongo will automatically generate an _id on insert.

I hope this is helpful!