title: Mongoose Typescript 2 Schema that have a field that use each other schemas
body: <p>I am trying to declare 2 schemas, using mongoose and typescript, that both have a field that their type is the other schema, like this:</p>
  <pre><code>const Schema1: Schema = new Schema({
      fieldA: Number,
      fieldB: Schema2
  
  };
  
  const Schema2: Schema = new Schema({
      fieldA : Number,
      fieldB : Schema1
  
  };
  </code></pre>
  <p>The problem is that i get an error, because the Schema2, on the fieldB of Schema1 is being used before being assigned.</p>
  <p>I already tried to declared it before like:</p>
  <pre><code>var Schema2: Schema = new Schema();
  </code></pre>
  <p>But then, when adding values to the database, Schema2 is just an empty schema with no fields.</p>