title: TypeScript + mongoose object in array remove
body: <p>I am having some difficulty with the removal of the object from the array by its _id /</p>
  
  <p><strong>USchema.ts</strong> </p>
  
  <pre><code>export interface IPayments {
  value: string;
  name: string;
  }
  
  export interface IUser {
      username: string;
      password: string;
      payments: Array&lt;IPayments&gt;;
  }
  var User = new Schema({    
      username: { type: String, required: true, unique: true },
      password: { type: String, required: true },
      payments: [{
          value: { type: String},
          name: { type: String}
      }]
  
  export interface UserDocument extends IUser, mongoose.Document {
     _id: string;
  }
  
  export var userSchema = User;
  export let userModel: mongoose.Model&lt;UserDocument&gt; = mongoose.model&lt;UserDocument&gt;('User', userSchema);
  </code></pre>
  
  <p><strong>Main.ts</strong></p>
  
  <pre><code>//delete elem from array "payments".
  let payment_id = new mongoose.Types.ObjectId(req.payment);
  let user = userModel.findOne({'_id': uid}).exec();
      user.then((user)=&gt;{
          user.paymens.remove(payment_id);
          user.save();
       });
  </code></pre>
  
  <p>Delete work fine, but TypeScript says </p>
  
  <blockquote>
    <p>Property 'remove' does not exist on type IPayments</p>
  </blockquote>
  
  <p>i try to add this "property" to interface, but still nothings</p>