docs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10
Build base and derived profile schemas that rely on virtual fields defined once on the base class. Virtuals must include getter and setter hooks and preserve configuration through inheritance.
fullName virtual that concatenates first and last names declared on the base class; updating either name updates fullName immediately. @testfullName string (e.g., "Ava Cole") to a derived profile document splits it into first and last names stored on the underlying fields. @testjustOne) and populating it returns a single mentor document tied to mentorId. @testfullName virtual and the mentor virtual without redefining them, including their getter/setter behaviors and options. @testexport class BaseProfile {
firstName: string;
lastName: string;
mentorId?: string;
birthYear?: number;
}
export class StaffProfile extends BaseProfile {
role: string;
startYear: number;
}
export class LeadProfile extends StaffProfile {
teamName: string;
}
export function registerProfiles(connection: unknown): {
baseModel: unknown;
staffModel: unknown;
leadModel: unknown;
};Provides schema decorators and utilities for defining and inheriting virtual fields with getter/setter hooks.