title: how to join two schema in nestjs?
body: <p>I have two schemas like </p>
  
  <p><strong>feature.schema.ts</strong></p>
  
  <pre><code>`import * as mongoose from 'mongoose';
  import { settings } from '../_settings';
    export const FeatureSchema = new mongoose.Schema({
       feature_name :{
              type : String
          },
          module_id :{
              type : mongoose.Schema.Types.ObjectId,
              ref : 'Modules'
          },
          status :{
              type : String,
              default: false
          }
  }, {...settings.options, collection: 'Features'}
  );`
  </code></pre>
  
  <p>and <strong>menus.schema.ts</strong></p>
  
  <pre><code>import * as mongoose from 'mongoose';
  import { settings } from '../_settings';
  
  export const MenusSchema = new mongoose.Schema({
      name :{
          type : String
      },
      feature_id: {
          type: mongoose.Schema.Types.ObjectId,
          ref: 'Features',
      },
      status :{
          type : String
      }
  }, {...settings.options, collection: 'Menus'}
  );
  </code></pre>
  
  <p>i try to join menus with feature, try to join in <strong>menus.service.ts</strong> like this</p>
  
  <pre><code>import { HttpException, HttpStatus, Injectable } from '@nestjs/common';
  import { InjectModel } from '@nestjs/mongoose';
  import { Model } from 'mongoose';
  import { IDMenus, IDFeature } from '@core/interfaces';
  import { MenusDto, FeatureDto } from '@core/dto';
  var ObjectId = require('mongoose').Types.ObjectId;
  
  @Injectable()
  export class MenusService {
      constructor(@InjectModel('Menus') private dataModel :Model&lt;IDMenus&gt;,
                  @InjectModel('Features') private ftModel :Model&lt;IDFeature&gt; ) {} 
  
    async findjoin(): Promise&lt;IDMenus[]&gt; {
      return this.dataModel.find().populate('Features.feature_id')
      .exec();
    }
  
  }
  </code></pre>
  
  <p>its result show no error,but don't get join result why ?
  the result is</p>
  
  <pre><code>{
          "_id": "5d6f606bbd12ad52b7ec618f",
          "name": "Inventry",
          "feature_id": "5d6f5d22bd12ad52b7ec618e",
          "status": "TRUE",
          "createdAt": "2019-09-04T06:57:47.212Z",
          "updatedAt": "2019-09-04T06:57:47.212Z",
          "id": "5d6f606bbd12ad52b7ec618f"
      }
  </code></pre>
  
  <p>how to get the join result,this is correct way of join?</p>