How to use the @typegoose/typegoose/lib/internal/data.models.entries function in @typegoose/typegoose

To help you get started, we’ve selected a few @typegoose/typegoose 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 kpfromer / nestjs-typegoose / src / typegoose-core.module.ts View on Github external
async onModuleDestroy() {
    const connection = this.moduleRef.get(this.connectionName);

    if (connection) {
      await connection.close();
      [...models.entries()].reduce((array, [key, model]) => {
        if (model.db === connection) {
          array.push(key);
        }
        return array;
      }, []).forEach(deleteModel);
    }
  }
}

@typegoose/typegoose

Define Mongoose models using TypeScript classes

MIT
Latest version published 10 days ago

Package Health Score

89 / 100
Full package analysis