title: NodeJS - MongooseJS schema error that i cant figure out
body: <p>Maybe a second set of eyes can see what is wrong with my schema</p>
  
  <pre><code>var UserSchema = new Schema({
          name: 
                  {
                          first : {type: String}
                      ,   last : {type : String}
                  }
      ,   password: {type: String}
      ,   username: {type: String}
      , role: RoleSchema
    , created_at  : {type : Date, default : Date.now}
    , modified_at  : {type : Date, default : Date.now}
  })
  
  var RoleSchema = {
          type: [String]
      ,   study_type: [String]
  }
  
  mongoose.model('User', UserSchema)
  </code></pre>
  
  <p>The Error:</p>
  
  <pre><code>TypeError: Invalid value for schema path `role`
  </code></pre>