The Model to add the new discriminator model to
The Class to make a discriminator model from
Optional
options: IModelOptionsOverwrite ModelOptions (Merged with ModelOptions from class)
Optional
class Main {
@prop({ ref: () => BaseDiscriminator })
public discriminators?: Ref<BaseDiscriminator>;
}
class BaseDiscriminator {
@prop()
public propertyOnAllDiscriminators?: string;
}
class AnotherDiscriminator {
@prop()
public someValue?: string;
}
const MainModel = getModelForClass(Main);
const BaseDiscriminatorModel = getModelFroClass(BaseDiscriminator);
const AnotherDiscriminatorModel = getDiscriminatorModelForClass(BaseDiscriminatorModel, AnotherDiscriminator);
// add other discriminator models the same way as "AnotherDiscriminatorModel"
Build a Model from the given Class and add it as a discriminator onto "from"
class Main {
@prop({ ref: () => BaseDiscriminator })
public discriminators?: Ref<BaseDiscriminator>;
}
class BaseDiscriminator {
@prop()
public propertyOnAllDiscriminators?: string;
}
class AnotherDiscriminator {
@prop()
public someValue?: string;
}
const MainModel = getModelForClass(Main);
const BaseDiscriminatorModel = getModelFroClass(BaseDiscriminator);
const AnotherDiscriminatorModel = getDiscriminatorModelForClass(BaseDiscriminatorModel, AnotherDiscriminator);
// add other discriminator models the same way as "AnotherDiscriminatorModel"
Build a Model from the given Class and add it as a discriminator onto "from"
The Model to add the new discriminator model to
The Class to make a discriminator model from
Optional
value: stringThe Identifier to use to differentiate documents (default: cl.name)
Optional
Optional
options: IModelOptionsOverwrite ModelOptions (Merged with ModelOptions from class)
Optional
class Main {
@prop({ ref: () => BaseDiscriminator })
public discriminators?: Ref<BaseDiscriminator>;
}
class BaseDiscriminator {
@prop()
public propertyOnAllDiscriminators?: string;
}
class AnotherDiscriminator {
@prop()
public someValue?: string;
}
const MainModel = getModelForClass(Main);
const BaseDiscriminatorModel = getModelFroClass(BaseDiscriminator);
const AnotherDiscriminatorModel = getDiscriminatorModelForClass(BaseDiscriminatorModel, AnotherDiscriminator);
// add other discriminator models the same way as "AnotherDiscriminatorModel"
Generated using TypeDoc
Build a Model from the given Class and add it as a discriminator onto "from"