Add Mongo

This commit is contained in:
2023-04-23 22:04:03 +08:00
parent 2d492f3263
commit 4e4301d18c
3 changed files with 116 additions and 1 deletions

View File

@@ -22,12 +22,25 @@ import { MySqlCompanyModule } from './mysqlcompany/mysqlcompany.module';
ConfigModule.forRoot(),
// For ORM-MySQL
TypeOrmModule.forRoot({
// ---- Mongo
// To set auth, run mongo shell: mongosh -u root -p example
// use boilerplate_nestjs_api_crud_company
// db.createUser( { user: "root", pwd: "example", roles: ["dbOwner"] })
// ---
// type: 'mongodb',
// host: 'localhost',
// port: 27017,
// database: 'boilerplate_nestjs_api_crud_company',
// username: 'root',
// password: 'example',
// ---- MYSQL:
type: 'mysql',
host: 'localhost',
port: 23306,
username: 'root',
password: 'example',
database: 'boilerplate_nestjs_api_crud_company',
// ------
// entities: ['dist/modules/**/*.mysql.entity{.ts,.js}'],
autoLoadEntities: true,
// IMPORTANT: disable sync