title: How to create database collection with typeorm on Atlas MongoDb?
body: <p>I have been using Mysql and pg Typeorm with Nestjs on projects which work fine. I decided to use mongo Atlas, I have connected successfully to Atlas with no error but collection not created. Whenever I use mysql with these steps, the table will be created. </p>
  
  <p>That is not happening with mongo, maybe I am not doing something right</p>
  
  <p>I also installed dependency</p>
  
  <pre><code>npm i --save @nestjs/typeorm typeorm @types/mongodb mongodb
  </code></pre>
  
  <p>ormconfig.json</p>
  
  <pre><code>{
      "type": "mongodb",
      "url": "mongodb+srv://dbUser:&lt;password&gt;@&lt;database&gt;.mongodb.net/test?retryWrites=true&amp;w=majority",
      "useNewUrlParser": true,
      "synchronize": true,
      "useUnifiedTopology": true,
      "logging": true,
      "ssl": true,
      "entities": [
          "dist/**/*.entity{.ts,.js}"
      ]
  }
  </code></pre>
  
  <p>app.module.ts</p>
  
  <pre><code>import { Module } from '@nestjs/common';
  import { TypeOrmModule } from '@nestjs/typeorm';
  
  import { AppController } from './app.controller';
  import { AppService } from './app.service';
  
  @Module({
    imports: [TypeOrmModule.forRoot()],
    controllers: [AppController],
    providers: [AppService],
  })
  export class AppModule { }
  </code></pre>
  
  <p>test.entity.ts</p>
  
  <pre><code>import { Entity, Column, CreateDateColumn, ObjectIdColumn, ObjectID } from 'typeorm';
  
  @Entity('Test')
  export class TestEntity {
      @ObjectIdColumn()
      id: ObjectID;
  
      @Column()
      firstName: string;
  
      @Column()
      lastName: string;
  
      @Column()
      age: number;
  
      @CreateDateColumn()
      created: Date;
  }
  </code></pre>
  
  <p>I appreciate your effort</p>