title: Mongoose schema: how to set max number of items in an array?
body: <p>I have a mongoose schema, that contains an array of objects and an array of strings. How to set validators in order to limit the number of items that can be inserted to 10 in these two cases?</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>    todoList: [{ type: String }],
      pictures: [{ type: String }],</code></pre>
  </div>
  </div>
  </p>