title: TypeOrm and MongoDB, inserts not appearing in database
body: <p>I get a connection the following way:</p>
  <pre><code>async function getMongoConnection(): Promise&lt;Connection&gt; {
      const connection: Connection = await createConnection({
          type: &quot;mongodb&quot;,
          host: &quot;localhost&quot;,
          port: 27017,
          database: &quot;test&quot;,
          synchronize: true,
          logging: true,
          entities: [
              File
          ]
      });
  
      return connection;
  }
  
  export { getMongoConnection };
  </code></pre>
  <p>and I have the following entity definition:</p>
  <pre><code>@Entity({
      name: &quot;files&quot;
  })
  export class File {
      @ObjectIdColumn()
      id: ObjectID;
  
      @Column()
      filePath: string;
  
      @Column()
      fileSize: number;
  }
  </code></pre>
  <p>When I'm running a &quot;save&quot; or &quot;insert&quot; call, it seems to work fine, but running &quot;find&quot; on the manager throws a <code>Cannot read property 'prototype' of undefined</code> error. The collection doesn't appear in the database either when I'm checking it with MongoDB Compass. <br />
  However, <code>manager.stats(File).count</code> is incrementing just fine.</p>
  <p>Here's the last bit of related code:</p>
  <pre><code>async function saveFileEntry(filePath: string) {
      const manager = (await mongoConnection).mongoManager;
      console.log(await (await (manager.stats(File))).count);
  
      const file = new File();
      file.filePath = filePath;
      file.fileSize = fs.statSync(filePath).size;
  
      manager.save(file)
      .then( (value) =&gt; {
          console.log(&quot;Saved file:&quot;);
          console.log(value);
  
          manager.find(File)
          .then( (files) =&gt; {
              files.forEach( (file) =&gt; {
                  console.log(&quot;Found file:&quot;);
                  console.log(file);
              });
          })
          .catch( (error) =&gt; {
              console.log(`Couldn't find file: ${error}`)
          });
      })
      .catch( (error) =&gt; {
          console.log(`Couldn't save file: ${error}`);
      });
  }
  </code></pre>