or run

tessl search
Log in

Version

Files

tile.json

rubric.jsonevals/scenario-2/

{
  "context": "Evaluates how the solution uses @nestjs/mongoose's async connection configuration APIs to supply MongoDB connection options. Focuses on correct use of factory, class-based, and existing provider patterns along with option propagation and connection naming.",
  "type": "weighted_checklist",
  "checklist": [
    {
      "name": "useFactory setup",
      "description": "Registers the module with `MongooseModule.forRootAsync` using `useFactory`, injects the config dependencies, awaits the async factory, and returns a complete `MongooseModuleOptions` (including URI and any extra driver options).",
      "max_score": 30
    },
    {
      "name": "useClass provider",
      "description": "Uses the `useClass` pattern so a provider implementing `MongooseOptionsFactory` (or equivalent with `createMongooseOptions`) is resolved by Nest, awaited, and its options merged with the injected TLS flag before passing to `forRootAsync`.",
      "max_score": 25
    },
    {
      "name": "useExisting reuse",
      "description": "Configures `useExisting` so an already-registered provider is reused for `forRootAsync`, ensuring Nest does not create a new instance and the provider method is invoked only once for option resolution.",
      "max_score": 20
    },
    {
      "name": "Option passthrough",
      "description": "Preserves and forwards optional fields supported by `MongooseModuleOptions` (e.g., `appName`, `tls`, auth fields, extra driver options) from whichever async provider is used instead of reconstructing partial options.",
      "max_score": 15
    },
    {
      "name": "Connection naming",
      "description": "Propagates a provided `connectionName` through `forRootAsync` so the configured connection is registered under the expected token (compatible with `getConnectionToken`/`InjectConnection`).",
      "max_score": 10
    }
  ]
}