title: Incorrect document typing during array operations
body: <p>I'm trying to get order sum but when i using reduce method I'm getting issue with types.</p>
  <pre><code>TS2345: Argument of type '(previousValue: any, currentValue: ObjectId) =&gt; void' is not assignable to parameter of type '(previousValue: ObjectId, currentValue: ObjectId, currentIndex: number, array: ObjectId[]) =&gt; ObjectId'.   Type 'void' is not assignable to type 'ObjectId'.
  </code></pre>
  <p><strong>Product Schema</strong></p>
  <pre><code>import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
  import { Document, Types } from 'mongoose';
  
  @Schema({ versionKey: false, timestamps: true })
  export class Order {
    @Prop({ required: true, ref: 'Product' })
    products: Types.ObjectId[];
  
    @Prop({ required: true, ref: 'User' })
    user: Types.ObjectId;
  
    @Prop({ required: true })
    paymentMethod: string;
  
    @Prop({ default: 0 })
    totalAmount: number;
  
    @Prop({ default: 0 })
    itemsPrice: number;
  
    @Prop({ default: 0 })
    taxPrice: number;
  }
  
  export type OrderDocument = Order &amp; Document;
  
  export const OrderSchema = SchemaFactory.createForClass(Order);
  </code></pre>
  <p>And that's how my service looks like
  <a href="https://i.stack.imgur.com/UoEEB.png" rel="nofollow noreferrer">https://i.stack.imgur.com/UoEEB.png</a></p>
  <p>Any ideas how to make it right?</p>