- 
      
- 
        Save ruddfawcett/61742bd03c4647dd7bb4c9dc685143c8 to your computer and use it in GitHub Desktop. 
    How to access enumValues in mongoose from a Model or Document
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | 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