Skip to content

Instantly share code, notes, and snippets.

@asalant
Created October 11, 2012 04:20
Show Gist options
  • Select an option

  • Save asalant/3870139 to your computer and use it in GitHub Desktop.

Select an option

Save asalant/3870139 to your computer and use it in GitHub Desktop.
Ubiquitous JS example: Mongoose User
mongoose = require 'mongoose'
UserMixin = require '../../shared/user_mixins'
schema = new mongoose.Schema
email: { type: String, lowercase: true, required: true, unique: true }
name: { type: String, required: true }
passwordHash: { type: String }
User = mongoose.model('User', schema)
UserMixin(User)
module.exports = User
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment