docs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10
{
"context": "Evaluates how well the solution uses @nestjs/mongoose asynchronous model registration to build product schemas, apply runtime configuration, and wire discriminators. Checks async factory-driven schema creation, TTL handling, secret field configuration, and discriminator setup using the package APIs.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Async registration",
"description": "Registers the product schema through MongooseModule.forFeatureAsync with an AsyncModelFactory that uses useFactory/inject to await config loaders before creating the schema.",
"max_score": 25
},
{
"name": "Config to schema",
"description": "Propagates async ProductConfig values into the model by setting the collection name and connectionName in the AsyncModelFactory output (e.g., schema.set('collection', ...) or collection option).",
"max_score": 15
},
{
"name": "TTL index",
"description": "Builds the expiresAt TTL using Mongoose schema APIs (e.g., schema.index with expireAfterSeconds) based on the async ttlDays value returned to the AsyncModelFactory.",
"max_score": 15
},
{
"name": "Secrets policy",
"description": "Applies the async secrets list by configuring schema paths with select: false, required: true, and index: false (or removing indexes) through Mongoose schema methods/options.",
"max_score": 20
},
{
"name": "Discriminator wiring",
"description": "Registers digital and physical child schemas via the discriminators option on the AsyncModelFactory (or model.discriminator) so they inherit the base model while adding fields, with a shared discriminatorKey.",
"max_score": 20
},
{
"name": "Model injection",
"description": "Exposes the base and discriminator models through Nest providers using InjectModel tokens (respecting connectionName when set) so services can save and retrieve documents as in the tests.",
"max_score": 5
}
]
}