Skip to content

Instantly share code, notes, and snippets.

@amichaelgrant
Forked from bnoguchi/enum-access.js
Created April 12, 2013 20:09
Show Gist options
  • Save amichaelgrant/5374737 to your computer and use it in GitHub Desktop.
Save amichaelgrant/5374737 to your computer and use it in GitHub Desktop.
var mongoose = require('./index')
, TempSchema = new mongoose.Schema({
salutation: {type: String, enum: ['Mr.', 'Mrs.', 'Ms.']}
});
var Temp = mongoose.model('Temp', TempSchema);
console.log(Temp.schema.path('salutation').enumValues);
var temp = new Temp();
console.log(temp.schema.path('salutation').enumValues);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment