Updated for the newest version of Mongoose.