title: How to add nested array of objects with @Prop decorator from @nestjs/mongoose
body: <p>When I use a nested array of object in prop decorator:</p>
  <pre><code>@Schema()
  export class Child {
    @Prop()
    name: string;
  }
      
  @Schema()
  export class Parent {
    @Prop({type: [Child], _id: false}) // don't need `_id` for nested objects
    children: Child[];
  }
  
  export const ParentSchema = SchemaFactory.createForClass(Parent);
  </code></pre>
  <p>I get an error:</p>
  <pre><code>TypeError: Invalid schema configuration: `Child` is not a valid type within the array `children`.
  </code></pre>
  <p>How can I fix this if I need to use <code>@Prop({_id: false})</code> (to keep the nested schema independent)?</p>
  <hr />
  <p>If we change a prop decorator to <code>@Prop([Child])</code> it works, however we need to disable <code>_id</code> for nested object with:</p>
  <pre><code>@Schema({_id: false})
  export class Child {
    @Prop()
    name: string;
  }
  
  @Schema()
  export class Parent {
    @Prop([Child])
    children: Child[];
  }
  </code></pre>
  <p>And in this case we won't have generic Child object and we won't to use them as an independent Schema.</p>
  <p>Another way is to create <code>Child</code> schema and use it in <code>@Prop({type: [childSchema], _id: false})</code>, but that looks like an overhead.</p>