How to use the @nestjs/mongoose.InjectConnection function in @nestjs/mongoose

To help you get started, we’ve selected a few @nestjs/mongoose examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ZhiXiao-Lin / nestify / apps / service / src / cli / commands / mongo.command.ts View on Github external
constructor(
        private readonly cli: ConsoleService,
        private readonly seedService: SeederService,
        @InjectConnection()
        private readonly connection: Connection
    ) {
        this.cli
            .getCli()
            .version('0.1.0')
            .command('seed')
            .arguments('[models...]')
            .option('-d, --drop', 'Drop database')
            .description('Run all database seed files.')
            .action(this.seed.bind(this));
    }