title: How to allow only certain string values inside a Mongodb array using mongoose?
body: <p>I'm creating a server side application using <code>Node.js</code> and <code>Mongodb</code>. And i'm using <code>Mongoose</code> package to access <code>MongoDB</code> database. And, i would want my Mongoose array to only allow certain values to be pushed inside it. For eg. If i have configured my <code>mongoose</code> array to support values like <code>admin</code>, <code>user</code> and <code>course</code>, is there any way mongoose forbid pushing of values anything other than <code>admin</code>,<code>user</code> and <code>course</code> into the array ?</p>