Skip to content

Instantly share code, notes, and snippets.

@astrotars
Created January 11, 2013 19:15
Show Gist options
  • Select an option

  • Save astrotars/4513181 to your computer and use it in GitHub Desktop.

Select an option

Save astrotars/4513181 to your computer and use it in GitHub Desktop.
var Schema = mongoose.Schema,
ObjectId = Schema.ObjectId;
var userSchema = new Schema({
email: {
type: String,
index: true,
unique: true
},
password: String,
clients: []
});
userSchema.plugin(mongooseQuery);
userSchema.plugin(mongooseCreatedModified, {index: true});
module.exports = mongoose.model('User', userSchema);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment