Skip to content

Instantly share code, notes, and snippets.

@dickeylth
Forked from bnoguchi/enum-access.js
Last active August 29, 2015 14:11
Show Gist options
  • Save dickeylth/22c9508b6d935314c093 to your computer and use it in GitHub Desktop.
Save dickeylth/22c9508b6d935314c093 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