title: How to set limit for array size in Mongoose schema
body: <p>Would you be kind to tell me is there any way to set limitation on array size while creating Mongoose schema. For example</p>
  
  <pre><code> var peopleSchema = new Schema({
      name: {
          type: String,
          required: true,
          default: true
      },
     /* here I want to have limit: no more than 10 friends.
      Is it possible to define in schema?*/
      friends: [{
          type: Schema.Types.ObjectId,
          ref: 'peopleModel'
      }]
  })
  </code></pre>