MCPcopy
hub / github.com/Automattic/mongoose / Subdocument

Class Subdocument

types/schematypes.d.ts:595–618  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

593 }
594
595 class Subdocument<DocType = unknown> extends SchemaType implements AcceptsDiscriminator {
596 /** This schema type's name, to defend against minifiers that mangle function names. */
597 static schemaName: string;
598
599 /** The document's schema */
600 schema: Schema;
601
602 /** The constructor used to create subdocuments based on this schematype */
603 Constructor: typeof Types.Subdocument;
604
605 /** Default options for this SchemaType */
606 static defaultOptions: Record<string, any>;
607
608 discriminator<T, U>(name: string | number, schema: Schema<T, U>, value?: string): U;
609 discriminator<D>(name: string | number, schema: Schema, value?: string): Model<D>;
610
611 cast(
612 val: any,
613 doc?: Document<any>,
614 init?: boolean,
615 prev?: any,
616 options?: any
617 ): HydratedSingleSubdocument<DocType>;
618 }
619
620 class String extends SchemaType {
621 /** This schema type's name, to defend against minifiers that mangle function names. */

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…