title: Mongoose Types.Array throwing error while saving new document - Typescript
body: <pre><code>export interface User {
    roles: mongoose.Types.Array&lt;string&gt;,
  }
  
  /* user schema */
  const schema = new mongoose.Schema&lt;User&gt;({
     roles: {type: [String], required: true}
  })
  
  const Users = mongoose.model&lt;User&gt;(&quot;user&quot;, schema);
  </code></pre>
  <p>now if I fetch a document with <code>find</code>, I do get mongoose Array specific IntelliSense for <code>roles</code> array ($push, $pop, $addToSet, etc.</p>
  <p>But while saving a new document, typescript complains that roles Array <code>is missing the following properties from type 'Array&lt;string&gt;': $pop, $shift, addToSet, isMongooseArray, and 5 more.</code></p>
  <pre><code>const newUser: User = { roles: ['abc','xyz'] }
  new Users(newUser).save();
  </code></pre>
  <p>I can do a one-liner <code>save</code> like this:</p>
  <pre><code>new Users({roles: ['abc,xyz']).save();
  </code></pre>
  <p>and the error would go away. But I completely loose out on code-completion while saving a new document. How to make TS suppress warning while saving a new document having arrays without <code>$push, $pop etc</code> properties?</p>