title: Node.js - How to limit a number of items on a Mongoose Schema Array
body: <p>I've been trying to limit an array in a Mongoose Schema to exactly 5 items.</p>
  <pre><code>favorites: {
      type: Array,
      required: true,
      
  },
  </code></pre>
  <p>I need this specific array to have exactly 5 items (strings).</p>
  <p>Also I'm trying to limit this other one:</p>
  <pre><code>friends: {
      type: Array,
      default: []
  },
  </code></pre>
  <p>To a maximum of 5 and minimum of 0 (IDs).</p>
  <p>Thanks for the help!</p>